ADX Trend Filter EA — No Code

ADX as a trend-strength gate: why it's not a builder indicator, the iADX filter code in MQL5, and the closest no-code alternative — an ATR volatility filter.

📖 5 min read

📝 989 words

🏷️ MQL5 and Expert Advisors

Share this article:

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?

Not in AlfaTactix today. ADX is not among the indicators the MT5 Strategy Builder supports, so it cannot AND-gate a Step 3 signal. Two honest paths:

  1. Code the gate in MQL5 — one iADX handle reads the ADX line; AND it with your existing entry condition (outline below).
  2. Build a no-code trend EA with supported indicators — keep an SMA or EMA cross on Step 3 and add the ATR volatility filter on Step 4 instead. ATR gates on volatility, not trend strength, so it is a different filter, not an ADX substitute.

Disclosure: Educational guide — not financial advice.

Not this article: ADX Trend EA — No Code covers the same missing indicator used as the main signal (ADX + DMI), not as a filter.

Related guides: ADX Indicator (academy) · MA Crossover EA — No Code · Build EA Without Coding · EA Strategy Library


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 would 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

That question is a good one — it just is not one the Strategy Builder can answer today, since ADX is not a supported indicator.


ADX as Gatekeeper, Not as Entry Signal

The idea is sound: keep an existing entry signal (an MA cross, for example) and only take the trade when ADX says the trend has strength. In MQL5 that is one extra iADX check ANDed with the entry condition.

AlfaTactix's Strategy Builder does not have ADX to wire into that AND group. The closest built-in gate is the ATR volatility filter on Step 4, which asks a different question — "is the market moving enough" — rather than "is the trend strong."

Indicator reference: ADX (academy).


Different From ADX Trend EA (DMI Signals)

TopicThis article (filter idea)ADX Trend EA
ADX jobWould be a filter (ADX > 25)Would be the signal (DMI cross)
Status in AlfaTactixNot supported — manual MQL5 or the ATR filter insteadNot supported — manual MQL5 or an MA cross instead
Best search intent"ADX filter EA no code""ADX trend following EA"

Both pages describe the same missing indicator used two different ways. Neither is buildable in the Strategy Builder today.


ADX Filter in MQL5

A hand-written EA adds one iADX [1] handle and ANDs the reading with your existing entry:

// OnInit
adxHandle = iADX(_Symbol, PERIOD_H1, 14);

// OnTick, once per new bar
CopyBuffer(adxHandle, 0, 1, 2, adx);   // buffer 0 = ADX main line
bool trendStrongEnough = adx[1] > 25.0;
bool entrySignal = /* your MA cross or other condition */;
bool takeTrade = entrySignal && trendStrongEnough;

Read ADX on the last closed bar with CopyBuffer [2], same as any other indicator handle, so the filter does not change mid-bar.


A No-Code Alternative With Supported Indicators

The MT5 form supports the market's most-used indicators — RSI, SMA, EMA, WMA, MACD, Stochastic, Williams %R, CCI, Momentum, Bollinger Bands, ATR, Volume and OBV — plus four market filter families on Step 4: ATR volatility, market session, time range, and liquidity. The closest no-code build:

  • Step 3: SMA or EMA Golden Cross / Death Cross — see MA Crossover EA — No Code.
  • Step 4: ATR volatility filter, to skip trades in very quiet markets.

Honest limit: ATR measures volatility, not trend strength. It will not screen out a weak, low-ADX trend the way an ADX gate would — it only skips dead-quiet conditions. Treat it as a different filter, not an ADX substitute.


Compile and Backtest

Compile your .mq5 (hand-written, or exported from Code Generator for the supported-indicator version) with F7 → Strategy Tester Every tick [3] → Demo. Run it with and without the Step 4 ATR filter to see the effect on trade count and drawdown.

Strategy Tester vs Live.



Tactix AI on this workflow

AlfaTactix includes Tactix AI: use Tactix Studio to describe your idea in plain language and draft timeframes, signals, filters, and risk into the same six-step Strategy Builder form — or open Tactix Guide on any step when you only need a field explained. Review every value, then export MQL5 or Pine Script from Code Generator (form-first — not untested prompt-to-code).

Next Steps

References: MQL5 iADX [1] · CopyBuffer [2] · Strategy Tester [3].

Frequently Asked Questions

Not in AlfaTactix today. ADX is not among the indicators the MT5 Strategy Builder supports, so it cannot AND-gate a Step 3 signal. You can code the gate in MQL5 with iADX, or use the Step 4 ATR volatility filter instead — a different kind of filter, not an ADX substitute.

No — ADX measures trend strength only. Direction would come from your entry signal (an MA cross, for example) or from +DI / -DI, which the builder also does not support. See ADX Trend EA — No Code for that case.

Length 14 and a threshold around 25 are common starting values in hand-coded EAs. Tune with Strategy Tester runs on your own data if you build the gate in MQL5.

No. ATR (supported in the builder, Step 4) measures volatility, not trend strength. It can keep an EA out of very quiet markets, but it does not detect a weak trend the way ADX does.

No. Educational template only. Filters reduce some bad entries; they do not eliminate losses. Backtest and Demo on your broker.

Continue learning

Why Free MT5 EAs Fail

References

  1. MetaQuotes, MQL5 Reference. iADX. https://www.mql5.com/en/docs/indicators/iadx
  2. MetaQuotes, MQL5 Reference. CopyBuffer. https://www.mql5.com/en/docs/series/copybuffer
  3. MetaQuotes. MetaTrader 5 Built-in Trading Strategy Tester. https://www.metatrader5.com/en/automated-trading/strategy-tester

AlfaTactix is a no-code strategy builder for MetaTrader 5 (MQL5) and TradingView (Pine Script) traders who design and manage rule-based strategies.

Trading involves substantial risk of loss. AlfaTactix generates code from the rules you define and does not provide financial advice. Past or backtested performance does not guarantee future results.

© 2026 AlfaTactix. All rights reserved.