Directional Indicator (DI) EA: no-code builder for MT4 / MT5
TrendThe Directional Indicators (+DI and −DI) compare the strength of upward and downward moves: +DI crossing above −DI is bullish, crossing below is bearish. Often used together with ADX.
Rules you can build with it
Works as an entry rule or an exit rule. Short rules are mirrored automatically.
- Long+DI crosses above −DIShort+DI crosses below −DI
- Long+DI crosses below −DIShort+DI crosses above −DI
- Long+DI is above −DIShort+DI is below −DI
- Long+DI is below −DIShort+DI is above −DI
Settings
| Settings | Default | Range |
|---|---|---|
| Period | 14 | 2 – 50 |
How the backtest and the EA calculate it
+DI and −DI are the second and third lines of MT5's ADX indicator, with the same smoothing.
Signals use only closed candles and are filled at the next candle's open. The exported EA checks conditions in the same order, so you get similar results in the MT5 Strategy Tester.
Example strategies
Example 1
- Entry · Directional Indicator (DI) (14): +DI crosses above −DI
- Stop-loss 300 points, take-profit 600 points
Example 2
- Entry · Directional Indicator (DI) (14): +DI crosses above −DI
- Entry · Moving Average (50, EMA, Close): MA rises
- Stop-loss 300 points, take-profit 600 points
Examples are just a starting point: open one to change settings or add filters, then check it with backtests and robustness tests. Backtest results don't indicate future returns.