OPEN-SOURCE SCRIPT
Market Regime Detector

📊Market Regime - Algo Akademi (Market Filter System)
This indicator is a market regime filter designed to help traders avoid "choppy" price action and focus only on high-probability environments. Rather than providing direct Buy/Sell signals, it identifies when the market conditions are "ideal" for trend-following strategies.
When the background turns green, it means all your predefined criteria for a healthy market are met.
🔍 Core Logic (4-Point Confirmation)
The script uses a hybrid approach to analyze the market's "quality":
Trend Strength (ADX): It checks if ADX is above 25. This ensures you are not trading in a flat or sideways market.
Bullish Momentum (RSI): By ensuring RSI is above 50, it filters for zones where buyers have the upper hand.
Volatility Control (ATR %): It calculates the ATR as a percentage of price. If volatility is above 3%, the background stays clear to protect you from "stop-hunting" or extreme spikes.
Time Filter: It automatically excludes Mondays to avoid the typical weekly open manipulations and "fake-outs."
💡 How to Use
The "Green Light" Rule: Use this as a secondary filter for your existing strategy. If your main setup triggers while the background is green, the statistical probability of success is generally higher.
Compatibility: Works best on 15m, 1h, and 4h timeframes.
Asset Class: While optimized for general use, you can tweak the 3% volatility threshold in the code to better suit Crypto (high vol) or Forex (low vol).
Disclaimer: Trading involves risk. This tool is for educational purposes and should be used as part of a complete trading plan.
This indicator is a market regime filter designed to help traders avoid "choppy" price action and focus only on high-probability environments. Rather than providing direct Buy/Sell signals, it identifies when the market conditions are "ideal" for trend-following strategies.
When the background turns green, it means all your predefined criteria for a healthy market are met.
🔍 Core Logic (4-Point Confirmation)
The script uses a hybrid approach to analyze the market's "quality":
Trend Strength (ADX): It checks if ADX is above 25. This ensures you are not trading in a flat or sideways market.
Bullish Momentum (RSI): By ensuring RSI is above 50, it filters for zones where buyers have the upper hand.
Volatility Control (ATR %): It calculates the ATR as a percentage of price. If volatility is above 3%, the background stays clear to protect you from "stop-hunting" or extreme spikes.
Time Filter: It automatically excludes Mondays to avoid the typical weekly open manipulations and "fake-outs."
💡 How to Use
The "Green Light" Rule: Use this as a secondary filter for your existing strategy. If your main setup triggers while the background is green, the statistical probability of success is generally higher.
Compatibility: Works best on 15m, 1h, and 4h timeframes.
Asset Class: While optimized for general use, you can tweak the 3% volatility threshold in the code to better suit Crypto (high vol) or Forex (low vol).
Disclaimer: Trading involves risk. This tool is for educational purposes and should be used as part of a complete trading plan.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.