OPEN-SOURCE SCRIPT
Market Regime ST Direction (Short-Term Filter)

Overview
The Market Regime ST Direction indicator is a streamlined tool designed to identify the short-term market environment, specifically optimized for the Daily Chart. It serves as an über-clean trend and phase filter built to protect your trading strategy from taking unnecessary losses during difficult, choppy market conditions.
The indicator focuses exclusively on market direction, intentionally filtering out volatility noise and secondary market factors.
Why You Should Use This Indicator (The Value Proposition)
It is a fundamental truth in trading: no single strategy works in all market environments. Trend-following systems bleed capital in sideways ranges, while mean-reversion setups get destroyed in strong, runaway trends.
How It Works & Underlying Logic
The script intelligently decouples visual momentum from the actual trend regime logic:
How to Interpret It for Your Trading
Pro-Tip: Apply this indicator to the Daily chart of your favorite asset. If you trade a trend-following strategy on lower timeframes (e.g., 1H or 15M), strictly filter your entries based on the color of the Daily regime.
The Market Regime ST Direction indicator is a streamlined tool designed to identify the short-term market environment, specifically optimized for the Daily Chart. It serves as an über-clean trend and phase filter built to protect your trading strategy from taking unnecessary losses during difficult, choppy market conditions.
The indicator focuses exclusively on market direction, intentionally filtering out volatility noise and secondary market factors.
Why You Should Use This Indicator (The Value Proposition)
It is a fundamental truth in trading: no single strategy works in all market environments. Trend-following systems bleed capital in sideways ranges, while mean-reversion setups get destroyed in strong, runaway trends.
- Smart Loss Filtering: This indicator helps you decide when not to trade. It identifies unprofitable market phases before your account takes a hit.
- The Market Traffic Light: Use it as a higher-timeframe filter. Only allow long trades in the bullish (green) regime, short trades in the bearish (red) regime, and pause your strategy during the choppy (gray) regime.
- Clarity Over Overtrading: With its clear, color-coded separation, you can instantly see whether the market has a clean directional bias or is caught in the "chop."
How It Works & Underlying Logic
The script intelligently decouples visual momentum from the actual trend regime logic:
- The Visual Foundation (MACD Histogram): The baseline visual consists of a classic MACD histogram calculated on the typical price (hlc3). This displays the current momentum of the market.
- The Regime Filter (EMA Slope): Crucially, the color of the bars is not determined by the MACD. Instead, it is driven entirely by the slope (steepness) of the fast 20 EMA.
- The Noise Filter (Threshold): To prevent the indicator from constantly flickering back and forth with minor price ticks, a percentage-based threshold (Sideways Threshold, default: 0.15%) is implemented. The market is only classified as trending when the EMA slope cleanly exceeds this threshold.
How to Interpret It for Your Trading
- 🟩 Lime (Bullish Regime): The 20 EMA slope is strongly positive. The short-term trend is firmly up. Focus on Long setups.
- 🟥 Red (Bearish Regime): The 20 EMA slope is strongly negative. The short-term trend is firmly down. Focus on Short setups.
- ⬜ Gray (Sideways/Chop): The slope is too flat and remains within the threshold boundaries. Caution: This is where trend strategies usually experience their heaviest drawdowns. This is an excellent time to sit on your hands and wait on the sidelines.
Pro-Tip: Apply this indicator to the Daily chart of your favorite asset. If you trade a trend-following strategy on lower timeframes (e.g., 1H or 15M), strictly filter your entries based on the color of the Daily regime.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.