On this page
Back to tutorials

ADX Trend Filter EA — No Code

SMA Golden Cross with ADX Compare > 25 on Step 3 AND — gatekeeper filter, A/B backtest worksheet, distinct from ADX+DMI signal EA.

📖 16 min read

📝 3,200 words

🏷️ MQL5 & Expert Advisors

Share this article:

Try the workflow from this guide

Open the live demo first — no signup. Sign up later to save your strategy and export from Code Generator.


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: ADXCompare → 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 feelMA cross without filter
Below ~20Chop / sleepMany false fires
20–25EmergingMixed
Above 25Trending enoughFewer, 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

RoleIndicatorCondition type
Entry (primary)SMA or EMAGolden Cross / Death Cross
Filter (gate)ADXCompare > 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)

TopicThis article (E3 filter)ADX Trend EA
ADX jobFilter (Compare > 25)Signal strength gate
DirectionFrom MA crossFrom DMI diCross
Best search intent"ADX filter EA no code""ADX trend following EA"
Step 3 shapeSMA cross AND ADX CompareADX 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:

ParameterDefaultRangeNotes
Length141–100Standard Wilder-style period
Threshold250–100Used in some condition types
Smoothingnonesma/ema/…Optional — start with none

For Compare condition:

FieldStarter
Operator>
Value25

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:

#IndicatorConditionKey settings
1SMAGolden CrossPeriod 10 (slow 20 auto)
2ADXCompare> 25, Length 14

Step 3 — Signals (Sell)

Mirror:

#IndicatorCondition
1SMADeath Cross Period 10
2ADXCompare > 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):

RunADX Compare valueWrite down
A22Trades, max DD, profit factor
B25 (base)Same
C30Same

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):

VariantStep 3Net profitTradesMax DD %Notes
BaselineMA cross only
FilteredMA 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

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.

Build this EA in Strategy Builder

Start in the live demo — no signup required. Walk through signals, filters, and risk. Create a free account only when you want to save and export MQL5.

Frequently Asked Questions

On Step 3, put your entry on the primary indicator (e.g. SMA Golden Cross) and add ADX with Compare > 25 in the same AND group. ADX blocks trades when trend strength is weak. For ADX+DMI as the main entry, see ADX Trend EA — No Code instead.

No — ADX measures strength only. Direction comes from your primary signal (MA cross, Stochastic, etc.). DMI handles direction in the dedicated ADX trend article.

Length 14, Compare value 25 is the product default. Try 22–30 in Strategy Tester and compare trade count and max drawdown — not only net profit.

This guide uses Step 3 AND for clarity (one place to read the full entry). You can also combine Step 4 session/spread filters from Advanced MTF & Filters. Market Regime may reference ADX in some setups — Step 3 Compare is the straightforward filter pattern.

No. It reduces chop entries; trends still reverse. Backtest and Demo on your broker.

Continue learning

Why Free MT5 EAs Fail

Try Strategy Builder — no signup

Try Strategy Builder — No Signup