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
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。