ADX Trend-Following EA for MT5 — No Code
Quick Answer: ADX Trend EA Without Code
Quick answer: On Step 3 — Signals in AlfaTactix Strategy Builder, add ADX and DMI (both available in the indicator list). Buy (AND): ADX → Compare → Operator >, Value 25 · DMI → diCross → Direction Up. Sell (AND): ADX → Compare → >, 25 · DMI → diCross → Direction Down. Set ADX Length 14, Threshold 25, DMI Length 14. Risk on Step 5 → Save → export MQL5 from Code Generator → backtest H1 EURUSD with Every tick.
Disclosure: Educational guide — not financial advice.
Related guides: ADX Indicator (academy) · DMI Indicator · Supertrend EA — No Code · MA Crossover EA — No Code · Advanced MTF & Filters
What Is an ADX Trend-Following EA?
ADX (Average Directional Index) measures how strong a trend is — typically 0–100. It does not tell you up vs down by itself.
| Layer | Role |
|---|---|
| ADX | Filter: only trade when trend is strong (e.g. ADX > 25) |
| DMI | Direction: +DI vs -DI via diCross or trendDirection |
| Signal | Rule (starter) |
|---|---|
| Buy | ADX > 25 AND DMI diCross Up |
| Sell | ADX > 25 AND DMI diCross Down |
See MQL5 iADX in exported code.
Classic ADX Settings and When It Works
| Setting | Starter |
|---|---|
| ADX Length | 14 |
| ADX Threshold | 25 (Compare value) |
| DMI Length | 14 |
| Timeframe | H1 or H4 |
| Symbol | EURUSD, GBPUSD |
Works best: Established trends after ADX rises above 25.
Struggles in: Sideways markets — ADX below 25, whipsaw on DMI crosses. Add Step 4 session filter.
ADX academy guide · DMI academy guide.
ADX and DMI Parameters in Strategy Builder
ADX parameters
| Parameter | Range | Default |
|---|---|---|
| Length | 1 – 100 | 14 |
| Threshold | 0 – 100 | 25 |
| Smoothing | none, sma, ema, wma, smma, vwma | none |
| Smoothing Length | 1 – 100 | 14 |
| Offset | -50 – 50 | 0 |
| Source | Close, High, Low | Close |
| Direction | Rising, Falling | rising |
DMI parameters
| Parameter | Range | Default |
|---|---|---|
| Length | 2 – 100 | 14 |
| Source | Close, Open, High, Low | close |
| Smoothing | None, SMA, EMA, … | None |
| Smoothing Length | 1 – 100 | 14 |
| Offset | -50 – 50 | 0 |
ADX and DMI Condition Types Explained
ADX conditions
1. Compare — Operator + Value (use > 25 for trend strength).
2. Breakout — Direction, Threshold, Period, Confirmation, Volume Confirmation.
3. Slope — Direction (rising/falling), Period, Min Slope, Smoothing, Source.
4. Pattern — Pattern Type, Min Height, Min Width, Volume Confirmation.
DMI conditions (direction)
1. diCross — Direction Up/Down · Value (default 0) — use for this guide.
2. trendDirection — Direction · Period · Confirmation.
3. compare — Operator + Value.
4. Additional types in UI (breakout, slope, etc.) — same pattern as other indicators.
Logical combination: On Step 3, group (ADX Compare > 25) AND (DMI diCross Up) on Buy tab — see Build EA Without Coding for AND/OR groups.
Build the ADX Trend EA Step by Step
Step 1 — Name
ADX DMI Trend H1
Step 2 — Timeframes
H1 enabled.
Step 3 — Signals (Buy)
- Add ADX — Length 14, Threshold 25.
- Condition Compare → > → Value 25.
- Add DMI — Length 14.
- Condition diCross → Direction Up.
- Combine both with AND.
Step 3 — Sell
Mirror: ADX > 25 AND DMI diCross Direction Down.
Step 4 — Filters
Market Session London/NY optional.
Step 5 — Risk
SL/TP, lot size — EA Risk Management.
Step 6 — Save
Export, Compile, and Backtest
Code Generator → compile F7 → Strategy Tester Every tick → Demo.
Improvements: Filters and Risk
| Issue | Fix |
|---|---|
| Too many DMI crosses | Raise ADX Compare to 30 |
| Late entries | Add H4 ADX filter on Step 2 MTF |
| Range losses | Skip when ADX < 20 (invert Compare on filter tab) |
Next Steps
Try Strategy Builder — no signup: Open the live demo.
References: MQL5 iADX · Strategy Tester.