Filter Rules

Filter rules act as gates for your entry logic. Unlike entry rules that generate trade signals, filter rules determine whether those signals are allowed to execute. When a filter rule evaluates to false, all entry signals are suppressed — no new positions are opened until the filter condition is satisfied again. Filters are one of the most effective tools for improving strategy performance by avoiding unfavourable market conditions.

Canvas showing a Trend Filter connected upstream of entry rules

How Filters Gate Entry Rules

Filters sit upstream of entry rules on the canvas. When the strategy engine evaluates whether to open a position, it checks filter rules first. If any filter evaluates to false, the entry rules are not even evaluated — the entire entry pipeline is blocked.

This hierarchical evaluation has two important benefits:

  • Performance improvement. By preventing trades during unfavourable conditions (such as choppy, trendless markets for a trend-following strategy), filters remove losing trades from your results without affecting winning trades that occur during favourable conditions.
  • Computational efficiency. Because entry rules are skipped when a filter is false, strategies with expensive custom conditions evaluate faster during backtesting.

You can use multiple filters simultaneously. When multiple filters are present, all of them must evaluate to true for entries to be allowed (AND logic). This allows you to layer conditions — for example, requiring both a trending market and adequate volatility before any entries are considered.

Filters only affect new entries. They do not close or modify existing open positions. Once a position is open, only exit rules control when it is closed.

Trend Filter

Overview

The Trend Filter evaluates the overall market direction and only allows entries that align with the prevailing trend. This prevents trend-following strategies from entering during sideways or counter-trend conditions, and prevents mean-reversion strategies from fighting strong directional moves.

The filter uses a higher-timeframe moving average or ADX (Average Directional Index) to determine whether a trend is present and in which direction it is moving.

Trend Filter configuration showing method selection and parameters

Key Parameters

Parameter Description Default Range
Method Moving Average Direction, ADX Threshold, or Price vs. MA Price vs. MA
MA Period Lookback period for the moving average (used by MA-based methods) 200 10 – 500
MA Type Simple, Exponential, Weighted, or Hull SMA
ADX Period Lookback period for the ADX calculation (used by ADX method) 14 5 – 100
ADX Threshold Minimum ADX value required to confirm a trend is present 25 10 – 60
Timeframe The timeframe to evaluate the trend on (can differ from the strategy's primary timeframe) Daily
Direction Bias Allow only long entries, only short entries, or entries in the trend direction Trend Direction

Typical Use Case

A 200-period SMA trend filter on the daily chart is one of the most widely used configurations. When the price is above the 200 SMA, only long entries are allowed. When below, only short entries pass through. This simple filter can dramatically improve a trend-following strategy by removing entries against the dominant trend.

Filter Rule: Trend Filter
  Method: Price vs. MA
  MA Period: 200
  MA Type: SMA
  Timeframe: Daily
  Direction: Trend Direction Only

For mean-reversion strategies, invert the Trend Filter's logic. Allow long entries only when ADX is below the threshold (indicating a range-bound market), which is when mean-reversion setups are most effective.

Volatility Filter

Overview

The Volatility Filter controls entries based on current market volatility levels. Some strategies perform well in high-volatility environments (breakout strategies), while others require calm, stable conditions (mean-reversion strategies). This filter measures volatility using ATR, Bollinger Band width, or historical volatility and allows entries only when volatility falls within a specified range.

Key Parameters

Parameter Description Default Range
Method ATR Percentile, Bollinger Band Width, or Historical Volatility ATR Percentile
Period Lookback period for the volatility calculation 14 5 – 200
Percentile Lookback Number of bars used to calculate the percentile ranking of current volatility 100 20 – 500
Min Percentile Minimum volatility percentile required for entries 0 0 – 100
Max Percentile Maximum volatility percentile allowed for entries 100 0 – 100

Typical Use Case

For a breakout strategy, set the Volatility Filter to require ATR in the lower percentile range (20th–40th percentile). This targets periods of low volatility — often consolidation phases — where breakouts are most likely to produce sustained directional moves. Conversely, for a mean-reversion strategy, set the filter to require the upper percentile range (60th–90th percentile), where stretched price action is more likely to snap back.

Filter Rule: Volatility Filter
  Method: ATR Percentile
  ATR Period: 14
  Percentile Lookback: 100 bars
  Min Percentile: 10
  Max Percentile: 40

Time-of-Day Filter

Overview

The Time-of-Day Filter restricts entries to specific hours of the day, days of the week, or calendar periods. Market behaviour varies significantly across trading sessions — liquidity, spread, and volatility all change depending on which major financial centres are active. This filter allows you to target the sessions that are most favourable for your strategy's logic.

Key Parameters

Parameter Description Default Range
Start Time The earliest time of day that entries are allowed 08:00 00:00 – 23:59
End Time The latest time of day that entries are allowed 16:00 00:00 – 23:59
Timezone The timezone for the time window (exchange local, UTC, or your local timezone) Exchange Local
Days of Week Which days of the week entries are allowed (select one or more) Mon – Fri
Exclude Dates Specific dates to exclude from trading (holidays, known volatile events) None

Typical Use Case

For forex strategies focused on EUR/USD, limiting entries to the London-New York overlap session (12:00–16:00 UTC) captures the period of highest liquidity and tightest spreads. For equity index strategies, excluding the first and last 30 minutes of the trading session avoids the elevated volatility and wider spreads that characterise the open and close auctions.

Be cautious about over-fitting to specific time windows based on backtesting results alone. Market session dynamics can shift over time as participation patterns change. Use time filters to reflect structural market knowledge rather than curve-fitting to historical data.

News Event Filter

Overview

The News Event Filter pauses entries around scheduled high-impact economic events such as central bank rate decisions, employment reports, and GDP releases. These events can cause sudden, unpredictable price movements that invalidate the assumptions of most systematic strategies. The filter uses a built-in economic calendar to automatically identify upcoming events.

News Event Filter showing upcoming events and blackout window configuration

Key Parameters

Parameter Description Default Range
Impact Level Minimum event impact level to trigger the filter: High, Medium, or Low High
Pre-Event Window How long before the event to stop allowing entries 30 minutes 5 min – 24 hours
Post-Event Window How long after the event before entries are allowed again 30 minutes 5 min – 24 hours
Currencies Which currencies' events to monitor (based on the traded instrument) Auto-detect
Close Open Positions Optionally close any open positions before the event window begins No

Typical Use Case

A News Event Filter with a 30-minute pre-event and 30-minute post-event blackout window for high-impact events is a standard defensive configuration. This avoids entering positions during the elevated uncertainty surrounding major data releases while still allowing the strategy to trade during normal conditions. For more conservative approaches, extend the post-event window to 60 minutes to ensure the initial volatility has settled.

Filter Rule: News Event Filter
  Impact Level: High
  Pre-Event: 30 minutes
  Post-Event: 30 minutes
  Currencies: Auto-detect
  Close Positions: No

The News Event Filter uses historical economic calendar data during backtesting. This means your backtest results accurately reflect how the filter would have behaved around past news events, giving you confidence that the improvement is not based on look-ahead bias.

Correlation Filter

Overview

The Correlation Filter evaluates the relationship between your traded instrument and one or more reference instruments, allowing entries only when correlation falls within a specified range. This is particularly useful for multi-instrument strategies where you want to avoid taking correlated positions that amplify risk, or for strategies that rely on a specific inter-market relationship.

Key Parameters

Parameter Description Default Range
Reference Instrument The instrument to measure correlation against
Correlation Period Number of bars used to calculate the rolling correlation coefficient 50 10 – 500
Min Correlation Minimum correlation coefficient required for entries -1.0 -1.0 – 1.0
Max Correlation Maximum correlation coefficient allowed for entries 1.0 -1.0 – 1.0
Correlation Type Pearson, Spearman, or Kendall rank correlation Pearson

Typical Use Case

A pairs trading strategy on two correlated equity instruments uses the Correlation Filter to ensure the historical relationship remains intact before opening positions. The filter might require a minimum Pearson correlation of 0.7 over the past 50 bars. If the correlation drops below this level, the statistical relationship may have broken down, and the filter prevents new entries until the relationship re-establishes.

Filter Rule: Correlation Filter
  Reference: SPY
  Period: 50 bars
  Min Correlation: 0.70
  Max Correlation: 1.00
  Type: Pearson

Combining Filters for Robust Strategies

The most resilient strategies use a carefully selected combination of filters to define their ideal trading environment. A layered filter approach might include:

  1. Trend Filter — Ensures entries align with the higher-timeframe trend direction.
  2. Volatility Filter — Confirms that market conditions match the strategy's assumptions about price movement.
  3. Time-of-Day Filter — Targets the most liquid and predictable trading session.
  4. News Event Filter — Avoids the uncertainty surrounding major economic releases.

When layering filters, monitor the impact on trade frequency. Each additional filter reduces the number of valid entry opportunities. Use backtesting to verify that the improvement in win rate or risk-adjusted returns justifies the reduction in the number of trades.

Run a backtest with and without each filter to measure its individual contribution. A good filter should improve the profit factor or reduce the maximum drawdown without reducing trade count by more than 30–40%. If a filter eliminates most trades, it may be too restrictive.

Was this helpful? Let us know