Specification
Project: Donchian Breakout – Fully Mechanical System
Platform: MetaTrader 5
Timeframe: H1 Only
General Description
Develop a fully automated MT5 Expert Advisor implementing a mechanical Donchian breakout strategy with ATR-based trailing stop.
The EA must operate independently per symbol and be suitable for 24/7 VPS execution.
No discretionary logic. No time filters.
Trading Symbols
The EA must function correctly on:
-
EURUSD (Forex CFD)
-
US500 (Index CFD)
-
XAUUSD (Gold)
Each chart runs independently.
Maximum 1 open trade per symbol.
Timeframe Restriction
-
EA must operate ONLY on H1 chart.
-
If attached to another timeframe, EA must not trade.
Trading Signals
Indicator Definitions
-
Donchian Channel Period: 20 (default, editable)
-
ATR Period: 20 (default, editable)
-
ATR Multiplier: 2.5 (default, editable)
All indicators calculated using CLOSED candles only.
Long Entry Condition
-
A candle CLOSES above the previous 20-period Donchian High.
-
Entry executed at market open of the next candle.
-
Only if no open trade exists for that symbol.
Short Entry Condition
-
A candle CLOSES below the previous 20-period Donchian Low.
-
Entry executed at market open of the next candle.
-
Only if no open trade exists for that symbol.
Important Signal Rules
-
Breakout must be based on CLOSED candle only.
-
No intra-candle triggers.
-
Must prevent duplicate entries from same breakout candle.
Position Sizing
-
Risk per trade: 0.5% of account balance (editable input)
-
Stop distance determined by ATR-based initial stop
-
Lot size calculated automatically based on:
-
Stop distance
-
0.5% account risk
-
Symbol contract specifications
-
Must work correctly for indices and gold.
Stop Loss & Trailing Logic
Initial Stop Loss
-
Set at 2.5 × ATR(20)
-
Based on ATR value of most recently closed candle
Trailing Stop
-
Dynamic trailing stop based on 2.5 × ATR(20)
-
Stop must only move in profit direction
-
Stop must never widen
-
Trailing updates on every tick (preferred)
Trade Management Rules
-
Maximum 1 open trade per symbol
-
No pyramiding
-
No time filters
-
No news filters
-
New trade only after previous position fully closed
-
Magic number input required
Inputs (Editable Parameters)
-
Risk % (default 0.5%)
-
Donchian Period (default 20)
-
ATR Period (default 20)
-
ATR Multiplier (default 2.5)
-
Slippage
-
Magic Number
Error Handling & Safeguards
-
Prevent duplicate entries on same candle
-
Must handle broker requotes
-
Must function correctly after terminal restart
-
Must not open multiple trades accidentally
-
Must log errors clearly in Experts tab
Deliverables
-
Compiled .ex5 file
-
Full source code (.mq5)
-
Clear instructions for installation
-
Commented code
Testing & Acceptance
The EA must be tested on demo account.
Payment will only be released after:
-
Entry logic confirmed correct
-
Risk calculation verified accurate
-
ATR trailing logic verified
-
No execution or duplication errors
Budget
Maximum budget: <$500 USD (competitive quotes welcome)
Please confirm:
-
You understand closed-candle Donchian logic
-
You have built ATR-based trailing systems before
-
Estimated delivery time