Market Context
Understand sentiment analysis, economic indicators, and news integration.
Market Sentiment Scoring
The sentiment engine aggregates news, social media, and market news sentiment to calculate an overall mood score for supported assets. The engine uses a combination of data sources:
- NewsAPI: Aggregates and filters major news headlines.
- Google News (RSS): Integrates global RSS financial news feeds.
- StockTwits: Measures retail social media sentiment.
- Alpha Vantage: Incorporates publisher-attributed news sentiment.
Under standard conditions, these four sources are weighted equally (25% each) to produce a composite score.
Adaptive Weighting and Health Checks
The engine monitors the health of each API source. If a source experiences errors or rate limits (e.g., HTTP 429), it is down-weighted dynamically during the health window (1 hour). After the hour passes without further errors, the source recovers its full weight. This ensures transient outages do not skew overall sentiment.
Time-Decay and Timeframe Restrictions
- Time-Decay: Newer articles carry more weight than older ones, decaying with a half-life of 48 hours.
- Backtesting Isolation: When running backtests, only historical news sources (like Alpha Vantage) are queried for the specified historical window. This prevents lookahead bias (mixing today’s headlines into historical simulations).
Threshold Classifications
The sentiment score ranges from -1.0 (strongly bearish) to +1.0 (strongly bullish). The thresholds differ based on asset class volatility:
| Asset Class | Strong Bearish | Bearish | Neutral | Bullish | Strong Bullish |
|---|---|---|---|---|---|
| Crypto | $\le -0.40$ | $-0.40$ to $-0.10$ | $-0.10$ to $+0.10$ | $+0.10$ to $+0.40$ | $\ge +0.40$ |
| General/Fiat | $\le -0.25$ | $-0.25$ to $-0.10$ | $-0.10$ to $+0.10$ | $+0.10$ to $+0.25$ | $\ge +0.25$ |
The engine also tracks a 24-hour linear regression trend to classify the sentiment trajectory as improving, deteriorating, or stable.
Economic Calendar and Indicators
The economic engine monitors key macroeconomic data points from the FRED database. These indicators provide macro regime context to the trading algorithms:
- CPIAUCSL: Consumer Price Index (Inflation).
- PCEPI: Personal Consumption Expenditures Price Index (Inflation).
- FEDFUNDS: Federal Funds Effective Rate (Monetary Policy).
- DGS10 / T10Y2Y: 10-Year Treasury Yield and the Yield Curve spread.
- GDP: Gross Domestic Product (Growth).
- UNRATE / PAYEMS: Unemployment Rate and Nonfarm Payrolls (Labor Market).
The engine determines the overall market regime (e.g., overheating, stagflation, recession, goldilocks, easy money, or transitional) based on these macroeconomic trends.
News Filters and Trade Blocking
Users can enable the News Filter in their auto-trade settings. When active, this filter acts as a check before opening new automated positions.
- Macro Blocker: If the economic engine detects a transition to high-volatility regimes (such as an impending high-impact FOMC rate decision or CPI release), it can flag upcoming calendar events.
- Sentiment Block: If the composite sentiment score for a specific asset is contrary to the signal direction (e.g., a buy signal occurs while the asset’s sentiment is “Strongly Bearish”), the execution engine blocks the trade.