ADXR Trend Filter Strategy: How to Build It in Arrow Algo

An ADXR trend filter strategy is a gate, not a signal. It sits between your entry rule and your order and asks one question: is there enough trend here to bother? The Average Directional Movement Index Rating, or ADXR, is the ADX averaged with its own value from a set number of bars ago. That extra step makes it slower and steadier than the ADX, which is exactly what you want from a filter. Our ADXR guide explains the indicator. This post is about using it to decide when a trend strategy is allowed to trade.
Why Rate the ADX Instead of Reading It Raw?
The ADX measures trend strength on a scale from 0 to 100, without caring about direction. Above 25 is usually called a trend. Below 20 is usually called a range. Wikipedia’s entry covers the construction.
The trouble is that the ADX flickers. On a 1-hour chart it can cross 25 on Tuesday, fall back to 22 on Wednesday and cross again on Thursday. A filter built on the raw ADX switches on and off with it, and a trend strategy behind that filter gets three half-trades instead of one whole one.
The ADXR fixes this by averaging the current ADX with the ADX from a set lag ago. With a lag of 14, the reading is half today’s value and half the value from 14 bars back. A one-day spike barely moves it. A sustained rise moves it a lot. The result crosses thresholds less often and stays across them for longer. That is the whole point of using the ADXR as a filter rather than the ADX.
What Does the Filter Actually Block?
A trend filter does not generate trades. It removes them. Put a moving average crossover behind an ADXR filter and the crossover still fires in a range. The filter just refuses to pass the signal through. The strategy stands down.
Three kinds of trade get blocked:
- Range crossovers. The fast line crosses the slow line in a sideways market, price reverses within a few bars, and the trade loses a small amount. These are the majority of losing crossover trades.
- Exhaustion entries. A late crossover at the end of a long trend, when the ADXR has already started to fall. A rising-ADXR version of the filter catches these.
- First-leg entries. The very first crossover of a new trend, before the ADXR has climbed above the threshold. This is the cost of the filter, and it is real. You give up the start of some moves to avoid the chop.
The backtest tells you whether the trade is worth it. On most crypto pairs and most timeframes above 1-hour, it is.
Three Ways to Wire an ADXR Trend Filter
The Threshold Gate
Allow the entry only when the ADXR is above 25. This is the baseline. It cuts trade count by somewhere between a third and a half on a typical crossover system, and it removes most of the range trades.
The Rising Gate
Allow the entry only when the ADXR is above 25 and higher than it was 5 bars ago. This adds a direction to the filter. Trend strength has to be building, not fading. It blocks the late entries at the end of a trend. StockCharts covers why a rising reading matters more than the level.
The Hysteresis Gate
Switch the filter on when the ADXR crosses above 25. Switch it off only when it falls below 20. Between 20 and 25 the filter keeps whatever state it had. This stops the on-off flicker around a single threshold. It is the version most systematic traders settle on, because it behaves predictably when the reading hovers near the line.
Choosing the Threshold and the Lag
| Setting | Starting value | Effect of raising it |
|---|---|---|
| ADX period | 14 | Smoother ADX, slower to react |
| ADXR lag | 14 | More smoothing, more delay |
| On threshold | 25 | Fewer trades, stronger trends only |
| Off threshold | 20 | Filter stays on longer once triggered |
Keep the lag equal to the ADX period unless the backtest gives you a reason not to. A lag much shorter than the period adds little smoothing. A lag much longer makes the filter so slow that it misses whole trends.
Test the threshold in steps of 2 or 3 points around 25. If the strategy works at 25 but falls apart at 22 and 28, the filter is tuned to noise. If it holds from 20 to 30, you have something.
When Does the ADXR Filter Cost You?
The filter is a trade-off. It costs you in three situations:
- Fast reversals. A sharp V-shaped bottom goes from range to trend in a handful of bars. The ADXR is still averaging in the old range reading and stays below the threshold through the first leg. You miss it.
- Low-timeframe trading. Below the 1-hour chart, trends are short and the ADXR’s delay eats a large share of each one. The filter works best on 4-hour and daily charts.
- Exit logic. The ADXR is an entry filter. Using it to exit, by closing when the reading drops below 20, often cuts winners short during a pause in the trend. Keep exits on a trailing stop or on the crossover itself.
One more mistake is subtle. Traders sometimes put the filter on the exit as well as the entry, so a drop in the ADXR closes the position. Then the next crossover is blocked because the ADXR is still low. The strategy sits out the resumption of the trend it just left. Filter the entry. Leave the exit alone.
Putting the ADXR Filter on the Canvas
Here is the hysteresis version with a moving average crossover behind it. No code anywhere.
- Place a Data Watcher for the pair and timeframe, such as ETH/USDT on the 4-hour chart.
- Build the entry: two EMA blocks with periods 10 and 30, fed from the close, and a Crossover block that fires when the fast one crosses above the slow one.
- Add an ADXR block with period 14. Feed it high, low and close.
- Add a Condition block that checks whether the ADXR is above 25. Add a second one that checks whether it is below 20.
- Add a Latch block. Connect the above-25 condition to its set input and the below-20 condition to its reset input. The latch output is the filter state: on once triggered, off only after a drop below 20.
- Combine the crossover and the latch output with a Condition block set to AND. Connect that to a Buy action.
- For the exit, use a reverse Crossover block connected to a Sell action, with a stop-loss set on the order block.
For the rising gate instead, replace the latch with a Lag block on the ADXR set to 5 bars and a Condition block that checks the current reading is higher than the lagged one. AND that with the above-25 check and the crossover.
Backtest both with the filter and without it. The right comparison is not total profit. It is the number of losing trades removed against the number of winning trades lost.
What to Take Away
- An ADXR trend filter strategy blocks trend entries in ranges by requiring a smoothed trend-strength reading before a signal can pass.
- The ADXR is the ADX averaged with its own lagged value, so it crosses thresholds less often than the raw ADX.
- Hysteresis, on at 25 and off at 20, stops the filter flickering around a single line.
- The cost is the first leg of fast new trends. The backtest shows whether the trade-off pays on your pair and timeframe.
- In Arrow Algo the filter is an ADXR block, two Condition blocks and a Latch block, placed between the crossover and the order.
Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.
Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who've made the switch to systematic trading.