═══════════════════════════════════════════════════════════

E-RSI: ENHANCED RELATIVE STRENGTH INDEX

═══════════════════════════════════════════════════════════

E-RSI: Enhanced Relative Strength Index System

E-RSI (Enhanced RSI) is an experimental modification of Wilder's 1978 Relative Strength Index. The standard RSI uses fixed 30/70 thresholds to identify overbought/oversold conditions. E-RSI tests the hypothesis that these thresholds should vary based on macroeconomic conditions—specifically monetary liquidity (M2) and market sentiment. Whether this adds predictive value or just complexity remains an empirical question that this system attempts to answer through rigorous backtesting.

Modifications to Standard RSI:
RSI Calculation: Uses Wilder's original exponential smoothing formula. The base RSI remains unchanged—only the interpretation thresholds are modified.
M2 Money Supply Factor: Incorporates GDP-weighted M2 data from 5 economies (US 35%, EU 22%, China 25%, Japan 10%, UK 8%). The hypothesis: during monetary expansion, "overbought" may occur at higher RSI levels.
M2 Nowcasting: FRED M2 data has a 2-4 week lag. We use proxy data (Fed Balance Sheet, Treasury accounts) to estimate current M2. This introduces model uncertainty.
Sentiment Factor: News sentiment via VADER with exponential decay (λ=0.1). Limited to ~30 days of history due to API constraints, making historical backtests effectively M2-only tests.
Dynamic Thresholds: Overbought/oversold levels adjust based on M2 regime, sentiment, and volatility percentile. More parameters = more overfitting risk.


Classification System:
M2 Regimes: Expansion, Above Average, Below Average, Contraction (percentile-based classification of YoY M2 growth).
Sentiment Regimes: Very Positive, Positive, Negative, Very Negative (based on aggregated news sentiment scores).
Multi-Asset Parameters: Different default parameters for Equities, Crypto, Commodities, FX, Fixed Income. These are starting points, not optimized values.


Signal Definitions:
Signals combine RSI level with Z-score (standard deviations from rolling mean):
• STRONGLY_OVERSOLD: RSI < oversold AND Z < -2
• MODERATELY_OVERSOLD: RSI < oversold AND -2 ≤ Z < -1
• OVERSOLD: RSI < oversold threshold
• NEUTRAL: oversold ≤ RSI ≤ overbought
• OVERBOUGHT: RSI > overbought threshold
• MODERATELY_OVERBOUGHT: RSI > overbought AND 1 < Z ≤ 2
• STRONGLY_OVERBOUGHT: RSI > overbought AND Z > 2


Important: This is research software for testing a hypothesis, not a validated trading system. Backtesting results are subject to overfitting, survivorship bias, and other well-known pitfalls. The validation framework includes walk-forward testing and statistical significance tests—use them before drawing conclusions.

Disclaimer: This is a prototype implementation of the paper titled "Enhancing the Relative Strength Index with Global M2 Money Supply and News Sentiment: A Context-Aware Technical Indicator." Please note that this is not financial advice—it serves solely as a demonstration of AI capabilities.