Use ADX as a Trend Filter in Your MT5 EA — No Code
Can I use ADX as a trend filter in my MT5 EA without coding?
Yes. Keep your entry on the indicator you already trust (here: SMA Golden Cross / Death Cross). Add ADX on Step 3 in the same AND group: ADX → Compare → Operator >, Value 25, Length 14. The EA only trades crosses when ADX says the market is trending enough — not when chop is weak. Build in Strategy Builder → export → A/B backtest with vs without the filter.
Disclosure: Educational template — not financial advice.
Not this article: ADX Trend EA — No Code uses ADX + DMI as the main signals. Here ADX is the bouncer, not the headline act.
When Your MA Cross Keeps Lying in a Range
You know the movie. EURUSD H1: fast MA crosses up — you buy. Four hours later it crosses down — you sell. Repeat until the week is red.
The crossover is not "broken." It is doing exactly what crosses do in sideways markets: fire often, mean little.
ADX is the question you ask before the door opens: "Is there enough trend strength right now to bother?"
| ADX reading (typical) | Market feel | MA cross without filter |
|---|---|---|
| Below ~20 | Chop / sleep | Many false fires |
| 20–25 | Emerging | Mixed |
| Above 25 | Trending enough | Fewer, often cleaner |
You are not predicting the future. You are refusing bad weather for a trend tool.
Value of this guide: Exact Compare fields in Strategy Builder + an A/B backtest worksheet so you see if the filter helps your symbol — not a generic "ADX works" claim.
ADX as Gatekeeper, Not as Entry Signal
| Role | Indicator | Condition type |
|---|---|---|
| Entry (primary) | SMA or EMA | Golden Cross / Death Cross |
| Filter (gate) | ADX | Compare > 25 |
ADX does not say long vs short. Your MA cross does. ADX only says "not now" when strength is low.
Optional second gate (same build, Step 4): hasSpread, Market Session London — see MA Crossover EA and London Session Breakout.
Indicator reference: ADX (academy).
Different From ADX Trend EA (DMI Signals)
| Topic | This article (E3 filter) | ADX Trend EA |
|---|---|---|
| ADX job | Filter (Compare > 25) | Signal strength gate |
| Direction | From MA cross | From DMI diCross |
| Best search intent | "ADX filter EA no code" | "ADX trend following EA" |
| Step 3 shape | SMA cross AND ADX Compare | ADX Compare AND DMI diCross |
If you want +DI / -DI as direction, read the trend EA article. If you already love MA crosses but hate range chop, stay here.
ADX Compare Parameters in Strategy Builder
When you add ADX on Step 3, Parameters:
| Parameter | Default | Range | Notes |
|---|---|---|---|
| Length | 14 | 1–100 | Standard Wilder-style period |
| Threshold | 25 | 0–100 | Used in some condition types |
| Smoothing | none | sma/ema/… | Optional — start with none |
For Compare condition:
| Field | Starter |
|---|---|
| Operator | > |
| Value | 25 |
Condition types exist beyond Compare (breakout, slope, etc.) — for a filter, Compare is the clearest.
Build MA Cross + ADX Filter Step by Step
Target: H1 EURUSD (adjust symbol to yours).
Step 1–2 — Market context
Set symbol/timeframe per your workflow (Build EA Without Coding).
Step 3 — Signals (Buy)
Create AND group:
| # | Indicator | Condition | Key settings |
|---|---|---|---|
| 1 | SMA | Golden Cross | Period 10 (slow 20 auto) |
| 2 | ADX | Compare | > 25, Length 14 |
Step 3 — Signals (Sell)
Mirror:
| # | Indicator | Condition |
|---|---|---|
| 1 | SMA | Death Cross Period 10 |
| 2 | ADX | Compare > 25 |
Step 4 — Filters (optional but valuable)
- hasSpread — realistic for EURUSD
- Market Session — London or London+NY if you trade sessions
Step 5 — Risk
Stop loss + lot sizing; for funded habits add Account Protection — Prop Firm Consistency EA.
Save → export from Code Generator → compile once.
Tune Threshold Without Curve Fitting
Run three tester passes on the same dates (Every tick, same spread model):
| Run | ADX Compare value | Write down |
|---|---|---|
| A | 22 | Trades, max DD, profit factor |
| B | 25 (base) | Same |
| C | 30 | Same |
Pick the threshold that reduces chop without killing all good trends. If only run C is green, suspect overfitting — hold out 20% unseen dates (Strategy Tester vs Live).
Sweep workflow: Test 10 EA variations in one day.
Export, Backtest: Compare With and Without Filter
A/B worksheet (copy to spreadsheet):
| Variant | Step 3 | Net profit | Trades | Max DD % | Notes |
|---|---|---|---|---|---|
| Baseline | MA cross only | ||||
| Filtered | MA cross AND ADX > 25 |
Healthy outcome: Filtered run has fewer trades and often lower max DD — not always higher profit.
If filtered run has zero trades, threshold too high or wrong timeframe.
Tester guide: Backtest EA — Strategy Tester.
Next Steps
- EA Strategy Library — browse all 18+ no-code MT5 playbooks
- ADX Trend EA — No Code — when ADX+DMI are the signals
- MACD + RSI Confluence — another AND pattern
- Advanced MTF & Filters — Step 4 depth
Before you export tonight: Open the live Strategy Builder demo (no signup) and build only the Buy AND group: one Golden Cross + one ADX Compare. Watch the tree — if you instantly see "cross only when ADX allows," you have understood the filter. Then add Sell, Step 4 spread, and run the A/B sheet above on your broker's data.
References: ADX Indicator · Strategy Tester.