OPEN-SOURCE SCRIPT
Mis à jour Miggoy's regime overlay

A market-regime dashboard that scores the overall environment for swing trading and colors your chart background green, yellow, or red so you can tell at a glance whether conditions favor putting on risk.
The script grades three independent conditions, each worth one point:
1 · Price Structure — SPY stacked above its 10 EMA, with the 10 EMA above the 20 EMA. Confirms a clean short-term uptrend with price leading.
2 · Net 52-Week Highs minus Lows — More new highs than new lows across the market. A positive read means broad participation rather than a narrow rally.
3 · Volatility — Fear draining out of the tape, defined as VIX below its 20 EMA, and the 20 EMA below the 50 EMA (50 > 20 EMA > VIX). Signals a calm, trending environment rather than a spiking, defensive one.
Regime scoring
3 / 3 → GREEN — Full risk per trade, full aggression.
2 / 3 → YELLOW — Half risk, best setups only.
0–1 / 3 → RED — List building, no trades.
The chart background tints to match the regime, and a table summarizes each condition with a pass/fail check, the underlying values, and the suggested action. A "days in regime" counter tracks how long the current state has held.
Notes
All conditions are calculated on the daily timeframe regardless of your chart's timeframe, so the regime read stays consistent whether you're looking at a daily or an intraday chart.
Calculations use confirmed daily data with no lookahead, so the indicator does not repaint.
The high/low inputs default to YRHI.US and YRLO.US (52-week new highs and new lows). Adjust the symbols in settings if your data provider uses different tickers.
Alerts are included for each regime transition (green, yellow, red).
This is a decision-support tool for gauging market conditions, not a buy/sell signal generator. It tells you whether the environment supports trading, not what to trade.
The script grades three independent conditions, each worth one point:
1 · Price Structure — SPY stacked above its 10 EMA, with the 10 EMA above the 20 EMA. Confirms a clean short-term uptrend with price leading.
2 · Net 52-Week Highs minus Lows — More new highs than new lows across the market. A positive read means broad participation rather than a narrow rally.
3 · Volatility — Fear draining out of the tape, defined as VIX below its 20 EMA, and the 20 EMA below the 50 EMA (50 > 20 EMA > VIX). Signals a calm, trending environment rather than a spiking, defensive one.
Regime scoring
3 / 3 → GREEN — Full risk per trade, full aggression.
2 / 3 → YELLOW — Half risk, best setups only.
0–1 / 3 → RED — List building, no trades.
The chart background tints to match the regime, and a table summarizes each condition with a pass/fail check, the underlying values, and the suggested action. A "days in regime" counter tracks how long the current state has held.
Notes
All conditions are calculated on the daily timeframe regardless of your chart's timeframe, so the regime read stays consistent whether you're looking at a daily or an intraday chart.
Calculations use confirmed daily data with no lookahead, so the indicator does not repaint.
The high/low inputs default to YRHI.US and YRLO.US (52-week new highs and new lows). Adjust the symbols in settings if your data provider uses different tickers.
Alerts are included for each regime transition (green, yellow, red).
This is a decision-support tool for gauging market conditions, not a buy/sell signal generator. It tells you whether the environment supports trading, not what to trade.
Notes de version
Made the red background overlay brighterScript open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.