Trend and Sideways Detector
- Göstergeler
- Rafi'u Indra Pratama
- Sürüm: 1.0
A powerful yet lightweight indicator designed to automatically detect market conditions — whether the market is in an Uptrend, Downtrend, or Sideways phase — using a refined Bollinger Bands-based algorithm.
This tool helps traders eliminate guesswork and trade with clarity, especially in fast-moving markets like XAUUSD on lower timeframes.
⚙️ Core Features
✅ Automatic Trend Detection
- Detects Uptrend when price breaks above the Upper Bollinger Band
- Detects Downtrend when price breaks below the Lower Bollinger Band
- Detects Sideways when price returns inside the Bollinger range
✅ Visual Market Zones (Color-Based)
- 🟢 Uptrend Zone (Light Green)
- 🔴 Downtrend Zone (Light Pink)
- ⚪ Sideways Zone (Gray)
✅ Integrated Bollinger Bands
- Middle Line (Trend Reference)
- Upper Band (Breakout Confirmation)
- Lower Band (Breakout Confirmation)
✅ Dynamic Trend Switching
- Trend state updates in real-time based on price interaction with Bollinger Bands
- Smooth transition between trend phases without repainting behavior
🧠 How It Works (Logic)
- Uptrend starts when price closes above the Upper Band
- Downtrend starts when price closes below the Lower Band
- Trend ends / Sideways begins when price returns to the Middle Band
This creates a clear structure-based trading framework, ideal for:
- Breakout traders
- Scalpers
- Trend-following systems
- EA (Expert Advisor) integration
🎯 Best Use Cases
- Scalping on M1 – M15
- Gold (XAUUSD), Forex, Indices
- Filtering entries (avoid trading in sideways conditions)
- Combining with entry strategies (SMC, BBMA, Breakout, etc.)
⚙️ Input Parameters
- BB Period – Controls sensitivity of trend detection
- BB Deviation – Defines breakout strength
- Applied Price – Price type used for calculation
🚀 Advantages
✔ Simple and clear visual signals
✔ No complicated settings
✔ Works on all symbols and timeframes
✔ Perfect as a trend filter for EAs
✔ Helps reduce overtrading in ranging markets
⚠️ Notes
- This indicator does not provide entry signals, but acts as a market condition filter
- Best combined with your own strategy or Expert Advisor
