OPEN-SOURCE SCRIPT
Aggiornato 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.
Note di rilascio
Made the red background overlay brighterScript open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.