DoncianLongEdge
- Indicatori
- Wilna Barnard
- Versione: 2.3
- Attivazioni: 5
Overview
Donchian Long Edge is a modern take on Richard Donchian’s classic channel breakout strategy — adapted specifically for long-only momentum and reversal entries.
It combines the proven logic of Donchian breakouts with ATR-based buffers, rearm logic, and session-aware filters. The indicator highlights buy signals only, designed for trend-following and range-reversal trading approaches.
This version introduces session start/end markers and time-based signal filtering, making it especially useful for intraday and futures traders.
Trading Logic
1. Breakout Entry (Upper Channel – Lime Arrows)
-
A Buy signal is triggered when price closes above the Upper Donchian Band by more than:
ATR × InpATRBufferFactor -
The candle must also close green (close > open).
-
The signal is drawn only once after a confirmed breakout.
-
The system then “arms” again only when the upper band remains flat for InpFlatBars consecutive candles.
2. Reversal Entry (Lower Channel – Blue Arrows)
-
A Buy signal is also triggered when price closes below the Lower Band by more than:
ATR × InpATRBufferFactorfollowed by a bullish candle (close > open) within the next 2 bars.
-
This detects potential reversals off support zones.
3. ATR Integration
-
ATR (Average True Range) is used in three ways:
-
As a volatility-based breakout buffer.
-
For positioning signal arrows a safe distance below price ( InpArrowShiftATR × ATR ).
-
For on-chart ATR display (optional).
-
4. Time-Window Control
-
You can define a session start and end time (e.g., 09:00–21:00 broker time).
-
When enabled:
-
Signals are ignored outside this time window.
-
No signals are generated within the last hour of the session to prevent late entries.
-
Vertical lines are drawn between the Donchian bands at session open (green) and session close (red).
-
Inputs Explained
| Parameter | Description |
|---|---|
| InpPeriod | Donchian channel lookback period (e.g. 20 bars). |
| InpLineColor / InpLineWidth | Appearance of the upper/lower Donchian bands. |
| InpShowArrows | Toggles display of entry arrows. |
| InpArrowShiftATR | Arrow offset below candle (in ATR multiples). |
| InpUseAlerts / InpUsePush / InpUseEmail | Optional sound, push, or email alerts on signal. |
| InpShowATRLabel | Displays current ATR in lower-left corner. |
| InpATRPeriod | ATR calculation period (default 20). |
| InpATRBufferFactor | Buffer multiplier for breakout threshold (default 0.10). |
| InpATRLabelColor / InpATRFontSize / InpATRX / InpATRY | ATR label styling and chart placement. |
| InpFlatBars | Flat-band count before system re-arms after breakout. |
| InpUseTimeFilter | Enables trading time filter (session-based). |
| InpStartHour / InpStartMinute / InpEndHour / InpEndMinute | Defines trading session (24h format). |
| InpTimeLineColorStart / End | Vertical line colors for start and end time. |
| InpTimeLineWidthStart / End | Line thickness for session markers. |
Alerts
When enabled, you can choose between:
-
Pop-up alerts within MetaTrader.
-
Push notifications to your mobile app.
-
Email alerts sent via your terminal’s configured mail settings.
Each alert message clearly states:
Notes
-
Only long (buy) conditions are evaluated — no sell signals are produced.
-
This indicator works on all timeframes and symbols.
-
ATR and Donchian periods can be adjusted independently.
-
Invalid time configurations (e.g., start hour ≥ end hour) will cause initialization to fail, ensuring no misconfiguration occurs.
-
Use in combination with an Expert Advisor via iCustom() to automate entries.
Recommended Use
-
Daily / H1 / M30 charts for swing or intraday trades.
-
Combine with a trailing stop or volatility-based exit for trend continuation setups.
-
For automation, integrate with an EA that reads buffers:
-
Upper breakout signal: buffer index 3
-
Lower reversal signal: buffer index 5
-
