Skip to content
FREEEvery tool on the site is free. Unlimited downloads with a partner broker.See how →
MT5MT4soonCTRADERsoonTRADINGVIEWsoonPYTHONsoon
Trend & moving averages

Trend filter

Also called Trend confirmation filter, Direction filter, MA filter

A trend filter is a rule that only allows trade signals matching the direction of a chosen moving average, trend line or trend channel.

Trend filter on a real EURUSD H1 MT5 chart. 1: price stays above the EMA 200: only buy signals count; 2: pullback touches the line and holds; 3: price continues up
Trend filter on a real EURUSD H1 MT5 chart. 1: price stays above the EMA 200: only buy signals count; 2: pullback touches the line and holds; 3: price continues up

A trend filter is a condition added on top of an entry signal: price must be on the correct side of a chosen moving average, trend line or trend channel before that signal is allowed. It does not generate entries by itself; it only decides which signals from another method get taken and which get ignored.

Identifying a trend filter on a chart

  1. Pick one line to act as the filter - commonly a slower moving average such as the EMA 200 or SMA 200, though a trend line or trend channel can do the same job.
  2. Check which side of the line price is closing on: above it supports buy signals only, below it supports sell signals only.
  3. Check the slope of the line itself. It should point the same way as the side price sits on - rising while price is above it, falling while price is below it.
  4. Count how many recent candles closed on that side. One close is not a filter; a run of closes holding one side is.
  5. Apply the filter to a separate entry method (a pattern, a faster indicator, a crossover) and only act on the signals that agree with the filter's side.

Valid alignment vs a broken filter

A filter is doing its job when price closes on one side of the line for several candles, the line is visibly sloped in that direction, and pullbacks that touch the line hold and bounce without closing through it. A filter is weak or broken when price keeps chopping back and forth across a flat line, when the line has barely any slope, or when a close above is followed by a close below within a candle or two - that is whipsaw, not a trend. Using the filter line itself as the entry trigger, instead of only as a direction gate, also defeats the point of having a filter at all.

The EURUSD H1 example, marker by marker

In this past EURUSD H1 example, price closed above the EMA 200 for 15 candles in a row while the line itself was rising.

  • Marker 1: at 2026.01.21 15:00, price was at 1.1743, above the EMA 200. With the filter reading up, only buy signals from another method would have counted here.
  • Marker 2: at 2026.01.22 01:00, the candle's low (1.16700) touched the EMA 200 (1.16707) and the candle still closed above the line. That is the filter line being tested by a pullback and holding.
  • Marker 3: at 2026.01.22 16:00, price had continued up to 1.17255, consistent with the broader move of 52 pips over the 15 candles following the touch.

This is a record of one past chart, not a forecast of how the next pullback will behave.

//Setup: trading the pullback that holds the filter

Hypothetically, a trader using the EMA 200 as a filter would still need a separate entry trigger. In this image, the close back above the line at 2026.01.22 01:00 (low 1.16700 against an EMA 200 of 1.16707) is the point where the pullback could be read as holding. A hypothetical stop loss would sit a few pips below that pullback low, under 1.16700, since a close through it would mean the filter no longer supports the trade. A hypothetical target has no fixed number here - in this past example price simply kept moving while it stayed above the line, covering 52 pips over 15 candles up to marker 3 at 1.17255. None of these levels are a recommendation for the next setup; they only describe what happened on this one chart.

When a trend filter works well, and when to skip it

A filter earns its keep in a market that is actually trending, where price spends long stretches on one side of the line. It struggles in a range, where price keeps crossing the line both ways and flips the filter on almost every signal. On EURUSD H1, price closed across its SMA 20 an average of 13.6 times a week versus 4 times a week for the SMA 200 (2025-10-02 to 2026-10-02, 6,222 candles, past data, not a forecast); XAUUSD H1 showed a similar gap, 13 times a week for the SMA 20 against 3 times a week for the SMA 200 over the same period. A faster line as the filter flips far more often than a slow one.

The moving-average pair you choose for the filter matters too. On EURUSD H1, the SMA 50/200 pair crossed 3.5 times a month on average with 0% of those crosses reversed within 5 candles, while the EMA 9/21 pair crossed 22.6 times a month with 21% reversed within 5 candles (same period, 6,222 candles, past data, not a forecast). That is one reason a slower pair is more often used for the filter role, and a faster pair for the entry trigger.

ProsCons
Removes signals that fight the larger directionLags - the line reacts after price has already moved
Works with almost any entry method as the triggerChops back and forth in a range, flipping often
Slower lines (50/200) flip less often, per lab data aboveA strict filter cuts the number of trades taken
Easy to see on a chart with one lineNo single line is the correct one - EMA 200, SMA 200 and a trend line can each read slightly differently at the same moment

Bullish and bearish trend filters

A bullish trend filter requires price to close above the chosen line, with the line itself rising, and only allows buy signals through. A bearish trend filter is the mirror image: price closing below a falling line, allowing only sell signals. A trend line or trend channel can replace the moving average as the filter line - see Trend line and Trend channel for how those are drawn and read.

Setting up a trend filter in MT5

  • Use a slower line as the filter and a separate, faster signal as the trigger. Don't make one line do both jobs.
  • Require a full candle close on the correct side of the line before counting a signal - a wick poking through doesn't count.
  • Decide the timeframe in advance. The same line can read as a bullish filter on H4 and a bearish one on H1 at the same moment.
  • Re-check the filter on every new candle rather than acting on a reading from several candles back.
  • Plot the line directly on the chart (Insert > Indicators > Trend > Moving Average in MT5, or an EA's own filter input) so the alignment is visible, not just calculated.
  • If backtesting a filter, check it across enough candles to cover several full swings, not just a handful of recent bars.

//Quick checklist

  • Price has closed on one side of the filter line for several candles in a row.
  • The line itself is sloped the same way as that side.
  • Only signals agreeing with that side are taken; the rest are skipped.
  • A pullback that touches the line and closes back on the same side confirms the filter still holds.
  • Price chopping across the line means wait, not force a reading.

Related terms