Home › Documentation › Data & indicators
Block · Filters

Regime filters

A filter is a fixed condition, chosen by you, that narrows down when trading is allowed: you only enter if the market is in the regime you want (with the trend, volatile enough, in the right session…). They are applied per direction — one set of filters for Long and another for Short — as a mandatory AND on the entry.

The idea: a fixed gate, not an optimized one

Per direction

Long and Short each have their own set of filters. The usual setup: longs only in an uptrend, shorts only in a downtrend.

Fixed (anti-overfit)

You choose them as a hypothesis; the engine does not optimize them. That avoids data-mining and does not multiply the size of the search space.

Entry only

They gate when the position is opened. The exit, the TP and the SL are unaffected.

// Only trade longs with the trend and on volume
Close > SMA(Close,200) & Volume > mean(20)

Filter library

Every filter carries a bias: Bullish, Bearish or Neutral (symmetric, usable in both directions).

Trend
  • Close > SMA(200)
  • SMA(50) > SMA(200)
  • EMA(20) > EMA(50)
  • SMA(200) > SMA(200)[10] (rising average)
  • SMA(100) > SMA(100)[10]
  • ROC(Close,50) > 0
  • + their bearish mirrors (<)
Volatility
  • ATR(14) > ATR(14)[5] (volatility expanding)
ADX
  • ADX(14) > 25 (trending)
  • ADX(14) < 20 (sideways)
Volume
  • Volume > mean(20)
  • Volume > 1.5× mean(20)
Momentum
  • RSI(14) > 50 · RSI(14) < 50
  • ROC(Close,20) > 0
Time
  • DayOfWeek = Monday
  • HourOfDay > 8 (from 9am)
  • WeekOfMonth = 1 (first week)
  • DayOfMonth > 24 (month end)
  • Month > 9 (last quarter)
  • MinuteOfDay > 569 (from 09:30)
↩

Offset [n]

Any indicator can reference its value from n bars back, just like price does (Close[1]). By convention SMA(Close,200) is the same as SMA(Close,200)[0] (the current bar); the [0] is left out and only [n>0] is shown.

// 200-period average rising (positive slope)
SMA(Close,200) > SMA(Close,200)[10]
// Volatility expanding
ATR(14) > ATR(14)[5]

Where they are used

Browse · Indicator Management

A Filters tab (next to Indicators, Patterns and Measures) lists the library with its expression, category and a Bias: label (Bullish / Bearish / Neutral).

Choose · Mass Test

The Filters… button opens a panel with two columns, Long and Short: tick which filters gate each direction. The button shows the count: Filters (L:2 S:1).

In the results, the export and the templates

In the CONDITION column of the results, the filter appears as its own segment at the end of the name, next to the entry, the exit and the TP/SL:

Close > SMA(Close,50) [Exit:RSI(14) > 70] [TP:2% SL:1%] [Filter:Close > SMA(Close,200)]
Export: filters travel inside the entry conditions, so they are emitted as an AND in EasyLanguage, MQL5 and ProRealTime with nothing extra.
Templates: the per-direction filter selection is saved and loaded with the Mass Test template (older templates still work).

Technical limit: each strategy takes up to 8 entry conditions (GPU engine). Since filters add to the signal conditions, MaxAnd + number of filters ≤ 8; if you go over, the Mass Test warns you before starting.

Try it yourself

AniQuant can be tried free for 30 days, with every module and no card.

← Previous
Candle measures
Next →
Entry conditions: thresholds and AND combinations
More in Data & indicators