Skip to content
strategies8 min read

ADX regime filtering: when the best trade is no trade (part 5)

How an ADX regime filter cut chop losses from a Binance futures trend bot. Trade above 25, sit flat below 20, hysteresis in between. Why doing nothing beats both alternatives.

A trader watching candlestick charts on a phone and laptop, the kind of setup where regime-filtering logic keeps you out of sideways markets you would otherwise trade and lose on

Affiliate disclosure: This post may contain affiliate links. If you sign up through a link on this page I may earn a commission at no extra cost to you. This does not affect my ratings. Learn more.

Roughly 60-70% of the time, crypto futures markets are not trending. They're grinding sideways, oscillating in a range, doing nothing a trend-following bot can profit from. Most trend-following bots trade anyway. And they bleed.

This is Part 5 of the build-in-public series documenting my Binance futures bot. Part 4 was about three live bugs a backtest can't catch, including the shared-margin sizing footgun that cost extra drawdown. This entry is different. It's not about a bug. It's about the core design decision that I think separates a trend bot that works from one that slowly dies.

The decision: detect when the market is ranging and stand flat. Do nothing. Zero positions. Wait.

Why pure trend-following bleeds in chop

A trend-following bot works by catching big moves and letting them run. The ATR bracket setup I'm running (stop at 3x ATR, take-profit at 6x ATR) is sized to have a win rate around 30-40%. It's profitable because the winners are roughly twice the size of the losers, not because it wins often.

The math only works if those big wins actually happen. In a ranging market, they don't. The bot enters on a UT Bot flip, the trade goes maybe 1x ATR in the right direction, reverses, hits the stop, and you're out for a full 3x ATR loss. Then it re-enters. Same outcome. It's not that the strategy is broken in those periods. It's doing exactly what a trend strategy does: waiting for sustained directional movement. But when the market isn't providing that, every entry becomes a chopped-up loser.

Over enough choppy periods, the cumulative losses from a pure trend system can wipe out multiple months of gains from trending periods. The gain-to-chop ratio depends heavily on how well you can avoid the ranging stretches.

Why mean-reversion isn't the answer for crypto futures at leverage

The obvious counter-argument is: "just switch to a mean-reversion approach during sideways markets." Buy at the bottom of the range, sell at the top. That's what grid bots do, and they genuinely thrive in chop. (I've reviewed the Pionex futures grid bot and Bitsgap's combo bot if you want to see that side of the equation, both are explicitly built for ranging markets.)

The problem with mean-reversion in leveraged futures specifically is that the ranges break. In spot crypto it can be fine, ranges form and hold for weeks. But futures at 10x leverage with perpetual funding introduces a different dynamic: the range snaps, the move is violent, and a mean-reversion position that was fine for three weeks gets destroyed in an afternoon.

I'm not saying mean-reversion is a bad strategy. It's a great strategy in the right vehicle. What I'm saying is that for a leveraged futures trend bot, the better answer to "what do you do in chop?" isn't "switch modes." It's "don't trade."

The edge in this strategy isn't the entry logic. It's the regime filter. Detecting the regime and sitting flat beats both alternatives.

How ADX measures trend strength (and what the thresholds mean)

ADX is the Average Directional Index, developed by J. Welles Wilder in 1978. It measures the strength of a trend without caring about direction. An ADX of 40 means strong trend, long or short. An ADX of 12 means sideways chop. The indicator has no idea which way price is going, just how orderly the movement is.

StockCharts' ChartSchool explanation of the ADX indicator documents the thresholds Wilder himself specified: strong trend at ADX above 25, no trend at ADX below 20. The band between 20 and 25 is an ambiguous zone, and that's the whole reason for hysteresis.

On the 4-hour Binance futures charts I'm running, those thresholds behave exactly the way the original research suggests:

When ADX is above 25, price is making consistent directional moves with meaningful follow-through. That's the environment a UT Bot + EMA crossover system was designed for.

When ADX is below 20, price is oscillating. Candles close red, the next green, reverses again. There's no momentum to catch and hold.

What is hysteresis and why does it matter here

Hysteresis just means: use different thresholds for turning something on versus turning it off. Don't use the same boundary in both directions.

Without hysteresis, the ADX filter creates a whipsaw problem of its own. Say you go to market when ADX crosses above 25 and step out when it drops below 25. In that ambiguous 22-25 zone, ADX oscillates. One bar it's 26 (trade!), next bar it's 24 (step out!), next bar 26 again. The regime filter itself becomes a source of noise.

The fix is the gap. Trade when ADX crosses above 25. Stay trading until ADX drops below 20. Between 20 and 25, don't change anything, hold whatever state you're already in. If you entered the zone trending, keep trading. If you entered the zone ranging, stay flat.

This means the filter has "memory." A bot in trading mode doesn't exit until ADX definitively says chop (below 20). A bot in flat mode doesn't enter until ADX definitively says trend (above 25). The 5-point buffer absorbs the noise in the transition zone without adding new noise.

An analytics dashboard on a laptop in a calm workspace, the kind of overview screen you look at when a regime filter is doing its job and the bot is correctly sitting flat on an uncertain day

How it plugs into the ensemble

Quick refresher on the full signal stack, since some readers are joining mid-series. Per symbol, on each 4-hour candle close:

  1. ADX check: if ADX is below 20 (ranging state), close any open position and place no new ones. Done.
  2. If ADX is above 25 (trending state), or between 20 and 25 in trending memory: proceed to the ensemble.
  3. UT Bot vote: trend direction from ATR trailing stop flip (key 2, ATR-10).
  4. EMA vote: direction of EMA 20/50 crossover.
  5. Both agree, full-size entry. One agrees, half size. They disagree, flat.

The ADX filter acts as a gate before the ensemble. If the gate is closed, the rest of the logic doesn't matter. No entry, no exit signal needed, just hold flat and let the market figure out what it wants to do.

The flat periods don't show up as wins in the P&L. They show up as avoided losses. Which is exactly as useful but a lot less satisfying to look at.

What this means for the live results

The bot has been live through a stretch that included both trending and ranging windows. The flat periods during ranging have produced zero profit and zero loss on the underlying positions, though funding costs still exist if you had any open (the filter closes them). Sitting flat for three or four days while the market chops burns nothing.

My central expectation for this system, after backtesting, artifact-correcting (see Part 3), and discounting for the gap between backtest and live, is still low-double-digit annual returns with significant variance. That number assumes the ADX filter is working as designed. Without it, I think the system would be roughly breakeven to negative in ranging markets, which describes a lot of the year.

I can't say the filter is "proven" yet. I don't have enough live trades for that. But structurally, the logic holds, and it matches the academic basis for Wilder's original thresholds, so I'm leaving it as designed until the data says otherwise.

A note on grid bots and why they're actually the right tool for what I'm avoiding

If you read this post and thought "so the ranging period is just wasted time?", the answer is kind of yes for a trend strategy. But for a grid bot? Those are the peak periods.

The Pionex futures grid bot and tools like Bitsgap's combo bot are explicitly designed to profit from the oscillation a trend bot avoids. They place limit orders above and below a central price, collect the spread every time price bounces, and do great in the very environment that wrecks trend systems. They also get destroyed in a strong trend, which is why the two strategies are genuinely complementary, not competitive.

If you're not sure which type of bot fits how crypto is moving right now, the bot-match quiz is worth spending five minutes on. It routes you based on current regime conditions and your risk tolerance rather than asking you to figure it out yourself.

The ADX regime filter, in a way, is doing the same thing the bot-match quiz does. It's asking "is this a trending or ranging environment?" before committing capital. The difference is it asks that question on every single candle, not once when you sign up.

That's the core of Part 5. The next entry will cover risk sizing as a linear dial: why 2x risk is exactly 2x return and 2x drawdown, no free lunch, and how to size knowing that a 25-35% drawdown is normal rather than a sign you broke something.

Full series on the journey page. Still honest. Still live.

Share:X / TwitterReddit
Hung Phu
Hung Phu
DCA BotsGrid BotsPythonCrypto FuturesBacktesting

Python algo trader since 2019. I build and test trading bots with real capital on Bybit and Binance. AlgoGrade is my lab notebook.

Related posts