PROTECTED SOURCE SCRIPT
Обновлено Market Breadth & Forward Returns

This indicator shows how future index performance has historically behaved after different levels of market breadth. The heatmap reveals which breadth zones have tended to precede better or worse forward returns. This is strictly a statistical conditional-expectation map, not a set of signals.
Scope
This is not meant for any arbitrary asset.
It is meant for broad indices only (S&P 500, Nasdaq 100, Dow, Russell, major sector families).
The breadth data is derived from index-level market universes.
Do not apply this on single stocks, crypto or FX. The method only makes sense with large diversified universes.
Core method
Daily breadth is normalized 0 to 100.
For each bar, six forward horizons are evaluated on the index: performance after X days.
Each observation is placed into a breadth bin.
Each bin/horizon pair has mean, variance and count computed.
Each bin/horizon mean is t-tested against zero.
Benjamini-Hochberg False Discovery Rate weighting allocates weight only to horizons where evidence exists.
Weighted horizon means are aggregated and annualized (252 trading days).
The map displays annualized conditional forward returns per breadth bin.
Why this is robust
Non-repainting. Breadth is in the past, returns are strictly future, lookahead_off.
Multiple horizons avoid single-window biases.
Variance, t-tests and FDR correction drastically reduce false positives.
Bins with poor sample size are visually suppressed to avoid over-interpretation.
How to use
Daily timeframe only.
Select the correct index family (S&P 500, Nasdaq 100, Russell…).
Bin size 5 to 10 points is a realistic range.
Min occurrences per bin ≥ 5 recommended.
FDR alpha 0.05 to 0.10 is a good working envelope.
Interpret as conditional expectations, not a forecast guarantee.
Notes
Do not use on random assets.
Do not extrapolate outside the chosen index family.
Always keep symbol and timeframe visible when publishing.
Indicator by Julien Eche
Scope
This is not meant for any arbitrary asset.
It is meant for broad indices only (S&P 500, Nasdaq 100, Dow, Russell, major sector families).
The breadth data is derived from index-level market universes.
Do not apply this on single stocks, crypto or FX. The method only makes sense with large diversified universes.
Core method
Daily breadth is normalized 0 to 100.
For each bar, six forward horizons are evaluated on the index: performance after X days.
Each observation is placed into a breadth bin.
Each bin/horizon pair has mean, variance and count computed.
Each bin/horizon mean is t-tested against zero.
Benjamini-Hochberg False Discovery Rate weighting allocates weight only to horizons where evidence exists.
Weighted horizon means are aggregated and annualized (252 trading days).
The map displays annualized conditional forward returns per breadth bin.
Why this is robust
Non-repainting. Breadth is in the past, returns are strictly future, lookahead_off.
Multiple horizons avoid single-window biases.
Variance, t-tests and FDR correction drastically reduce false positives.
Bins with poor sample size are visually suppressed to avoid over-interpretation.
How to use
Daily timeframe only.
Select the correct index family (S&P 500, Nasdaq 100, Russell…).
Bin size 5 to 10 points is a realistic range.
Min occurrences per bin ≥ 5 recommended.
FDR alpha 0.05 to 0.10 is a good working envelope.
Interpret as conditional expectations, not a forecast guarantee.
Notes
Do not use on random assets.
Do not extrapolate outside the chosen index family.
Always keep symbol and timeframe visible when publishing.
Indicator by Julien Eche
Информация о релизе
Minor updateИнформация о релизе
Minor update: small bugs fixedИнформация о релизе
Reduced lookback for lower load, shorter correlation window for more responsive penalty, and adjusted visual offsets to avoid label overlap.Информация о релизе
Minor update: small bugs fixedИнформация о релизе
Minor Update: Added explanatory tooltips to the main inputs to clarify how to interpret the breadth stats and use the options.Информация о релизе
Major Update: Macro-Economic Regimes IntegrationI have expanded the tool's capabilities beyond internal Market Breadth. You can now condition market returns based on two critical external macro drivers:
- Yield Curve Slope (10Y-2Y): The bond market's primary leading indicator for the economic cycle. This mode allows you to quantify market performance during distinct curve phases (e.g., deep inversion vs. normalization), offering insight into how equities react to recession signals and changing growth expectations.
- Credit Spreads (FRED OAS): The ultimate gauge of financial stress and liquidity. By tracking the spread between US High Yield bonds and safe Treasuries, this mode isolates market behavior during "Risk-On" complacency (low spreads) versus "Risk-Off" credit stress (high spreads).
These additions transform this indicator into a comprehensive Macro-Regime backtesting engine.
Информация о релизе
Minor update: added the new Real Rate (FRED DFII10) conditioning mode with full switch-based normalization.Информация о релизе
Minor update: added a new Bounds mode input (Dynamic vs Static) to control how regime bins are scaled. Dynamic keeps the current percentile-based rolling min/max, while Static locks slope/spread/real-rate ranges to fixed values. This prevents bins from drifting over time and makes historical regime comparisons consistent.Информация о релизе
Minor update: added the selected market name to the stats table header so the current market (e.g., S&P500) is always displayed.Информация о релизе
Minor UpdateСкрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Plan the trade ⚡ Trade the plan
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Plan the trade ⚡ Trade the plan
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.