Advertisement IC Markets

Regime Filters: Teaching a Strategy When to Sit Out

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Regime Filters: Teaching a Strategy When to Sit Out

Post by Fairman »

Regime Filters: Teaching a Strategy When to Sit Out

Most strategies work in one type of market and struggle in others. A regime filter is a rule that tells you which conditions are suitable, and lets you skip the rest.

Common regimes include trending, ranging, high-volatility, and low-volatility markets. A trend strategy wants trending conditions, and a mean reversion strategy wants ranges.

Several simple filters exist. ADX above 25 indicates a trending environment, below 20 a ranging one. ATR relative to its longer-term average shows whether volatility is elevated or depressed. The slope and position of a long moving average, such as the 200, reflect trend direction. Bollinger Band width signals compression or expansion.

Apply the filter before the signal. For example: take breakout signals only when ADX is above 20 and rising, and take range-fade signals only when ADX is below 20.

Filters reduce the number of trades, and the skipped periods are those where your strategy has no edge. Test whether the filter improves results out of sample, rather than assuming.

Avoid stacking too many filters. Each one adds a parameter and a risk of overfitting.

Sometimes the best regime filter is the calendar, avoiding trading around high-impact news or illiquid holiday periods.

Practical step: label each trade in your journal with the regime at entry and compare results by regime.
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by Fairman »

Simplest filter I've used: is the daily ATR above or below its 20-day average? Not fancy, but it splits sessions into quiet and active pretty well and some setups clearly prefer one or the other.
It’s Fairman :geek:
Fairman
Posts: 6955
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by Fairman »

Labeling each trade with the regime is the bit most people skip. Do it for a month and you'll often find your losses are bunched in one condition.
It’s Fairman :geek:
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by Shadow Trader »

One trap with the daily ATR filter is lookahead. If the test uses the ATR of the same day the trade happened, it already knows how big that day turned out to be, so the filter must read the previous day's value.
img_13007_r1.png
img_13007_r1.png (51.63 KiB) Viewed 276 times
Say you labelled 60 breakout trades by whether the prior day's ATR was above its 20 day average. In the chart, the 34 trades in the active regime average +0.4R for +13.6R, while the 26 quiet ones average -0.3R for -7.8R, so the whole set nets only +5.8R.

Dropping the quiet days more than doubles the result on 43 percent fewer trades. That looks convincing, but 26 trades is a thin sample to condemn a whole regime on, so check the split holds in each half of the data.

The other question is where the line sits. If moving the threshold from 1.0 times the average to 0.9 or 1.1 flips the result, the filter is fitting noise rather than describing a real difference in conditions.

News days tend to be high ATR days anyway, so the volatility split and the calendar filter overlap more than they look. Does anyone combine the two, or does stacking them leave too few trades to judge either one?
FXS Prop Desk
Posts: 1689
Joined: Wed Oct 07, 2026 9:52 am

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by FXS Prop Desk »

One practical regime filter that is easy to implement is the slope of a long moving average combined with ADX. For example, trend strategies only trade when the 100-period moving average is rising or falling and ADX reads over 20. Testing the strategy with and without the filter shows how much it improves results.

A filter should be tested out of sample too, since it adds parameters.
FXS Official Team | The Idea Lab & Strategy
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by Shadow Trader »

On the stacking question from my earlier post, the ADX and moving average slope pair FXS Prop Desk suggested makes a good test. Stacking tends to look better on average while the totals shrink.

The chart (illustration) carries on with the same made up 60 breakout trades. The ATR filter alone keeps 34 trades at plus 0.40R each, adding ADX above 20 leaves 21 at plus 0.48R, and adding a rising 100 period average leaves 12 at plus 0.55R.
img_13007_r2.png
img_13007_r2.png (63.91 KiB) Viewed 260 times
Average R keeps climbing, but total R goes from 13.6 to 10.1 to 6.6. Each filter cuts good trades with bad, and 12 trades is too few to tell improvement from luck.

Part of the reason is that ATR and ADX both measure how active the market is. Once the first is in place, the second adds a parameter without adding much information.

A fairer test is whether the second filter improves the trades the first one kept, in the early and late sample separately. If it only helps in one part, it is probably fitting noise.

Filters measuring different things, such as volatility plus time of day, tend to stack better. Has anyone found a pair that held up together out of sample?
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Regime Filters: Teaching a Strategy When to Sit Out

Post by Shadow Trader »

Markets shift between regimes, such as trending, ranging, quiet, and volatile. A strategy tuned to one regime may fail in another, so detecting the current state has value. Complex models exist, but simple statistics often suffice.

Candidates include the ratio of net price change to total path length over a window, which approaches one in strong trends and zero in ranges. Realized volatility relative to its recent average indicates quiet or active conditions. Autocorrelation of returns hints at momentum or reversal tendencies.

Each measure requires a window length and thresholds, and the choice should be tested out of sample. Regime filters tend to lag, since a regime is only confirmed after it has begun. Using them to reduce exposure during unfavorable conditions, instead of attempting to predict changes, is a modest but realistic goal. Comparing strategy results across regimes reveals which conditions suit it, and which should be avoided. Keeping the detection method simple reduces the risk of fitting noise.
Post Reply