Smart Box Indicator
- Indicators
- Version: 1.10
- Activations: 5
Smart Box Indicator
Precision Supply & Demand zones — automatically drawn from the latest swing high and swing low.
━━━ OVERVIEW ━━━
Smart Box Indicator cuts through chart noise and shows you exactly two things: the nearest SELL zone (supply) and the nearest BUY zone (demand). No clutter. No repainting. Just the two zones that matter right now — drawn automatically from your most recent swing high and swing low using a precise, rule-based algorithm.
✅ No repaint | All symbols | H1 and above | MT5 build 2755+
━━━ KEY FEATURES ━━━
▪ 2 zones only — 1 BUY + 1 SELL, always the most recent, never outdated
▪ Inside bar escalation — auto-upgrades timeframe H1→H4→D1→W1 when inside bars are detected
▪ Precise box coordinates — Supply: Low(1)/Low(2) | Demand: High(3)/High(4)
▪ Fully customisable — colors, opacity, midline, labels, lookback, extend bars
━━━ HOW IT WORKS ━━━
1. Detect the most recent swing high and swing low
Uses a configurable lookback (default 5 bars each side) to identify clean pivots.
2. Check for inside bars
If the candle before the swing is an inside bar, the algorithm escalates to the next higher timeframe and re-identifies the swing there — ensuring the zone is always valid.
3. Calculate zone boundaries
SELL zone: Top = Low(1), Bottom = Low(2)
BUY zone: Top = High(4), Bottom = High(3)
4. Draw and extend
Boxes are drawn from the origin candle and extended a configurable number of bars to the right, with optional midline and label.
━━━ INPUT PARAMETERS ━━━
• Swing Lookback (default 5) — bars each side to confirm a swing pivot
• Extend Bars (default 50) — how far right the zones extend
• BUY Color — fill color for the demand (BUY) zone
• SELL Color — fill color for the supply (SELL) zone
• Box Opacity (default 60) — zone transparency (0=solid, 255=invisible)
• Show Midline — dashed line at the midpoint of each zone
• Show Label — BUY / SELL text label at the right edge
• Show Swing Dots — arrow markers on all detected swing pivots
━━━ COMPATIBILITY ━━━
✔ All Forex pairs
✔ Gold / Silver (XAU, XAG)
✔ Indices & Commodities
✔ Crypto (BTC, ETH…)
✔ H1, H4, D1, W1, MN timeframes
✔ MetaTrader 5 (all builds)
━━━ NOTES ━━━
Best results on H1 and above. The indicator does not repaint — zones are finalized once the swing candle is confirmed. For best accuracy, allow at least 200 bars of history to load before reading the zones. If you have any questions or suggestions, feel free to contact me through MQL5 messages.
