OPEN-SOURCE SCRIPT
Market Regime Detector (1D RSI/ATR/MA) - Weekly Consensus

Market Regime Detector (1D RSI/ATR/MA) — Weekly Consensus
© Łukasz Wędel
🎯 Purpose
This indicator analyzes daily (1D) price data to determine the current market regime — Bullish, Bearish, or Choppy — and displays it on an intraday chart (e.g., 1H).
It acts as a higher‑timeframe trend filter, making trend‑following or range‑trading strategies more robust.
⚡️ How It Works
🕓 Timeframe Compatibility
Works best when applied to a 1H chart (or any intraday timeframe). RSI, ATR, and MA calculations are sourced from the 1D timeframe.
🎨 Visual Output
🚨 Alerts
Three alert conditions available:
✅ Why Use This?
🔥 Ideal For
© Łukasz Wędel
🎯 Purpose
This indicator analyzes daily (1D) price data to determine the current market regime — Bullish, Bearish, or Choppy — and displays it on an intraday chart (e.g., 1H).
It acts as a higher‑timeframe trend filter, making trend‑following or range‑trading strategies more robust.
⚡️ How It Works
- RSI + ATR Method: Bullish if RSI > Bull Threshold and ATR > Threshold; Bearish if RSI < Bear Threshold and ATR > Threshold; Choppy if RSI is between thresholds and ATR <= Threshold
- Moving Averages Method: Bullish if Short‑term MA > Long‑term MA, Bearish if Short‑term MA < Long‑term MA, Choppy if MAs are neutral
- Final Regime Decision: Final regime is confirmed if the same state occurs in 5 out of the last 7 daily bars
🕓 Timeframe Compatibility
Works best when applied to a 1H chart (or any intraday timeframe). RSI, ATR, and MA calculations are sourced from the 1D timeframe.
🎨 Visual Output
- [green]Green background:[/green] Final regime is Bullish
- [red]Red background:[/red] Final regime is Bearish
- [yellow]Yellow background:[/yellow] Final regime is Choppy
🚨 Alerts
Three alert conditions available:
- Final Bull Regime
- Final Bear Regime
- Final Chop Regime
✅ Why Use This?
- Provides a higher‑level trend context for lower‑timeframe trading
- Reduces noise by focusing only on confirmed trend regimes
- Supports trend‑following and range‑trading strategies
🔥 Ideal For
- Swing traders relying on trend and volatility confirmation
- Day traders seeking trend context from higher timeframes
- Algorithmic strategies that benefit from higher‑level trend filtering
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.