OPEN-SOURCE SCRIPT
Atualizado 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.
Notas de Lançamento
Made the red background overlay brighterScript de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.