Advanced Filtering: How to Make Your Strategy Trade Only in Favorable Conditions
Published 2026-07-11 · By Gogoboss
Advanced Filtering: How to Make Your Strategy Trade Only in Favorable Conditions
After completing the parameter optimization stage, the next logical step in building a robust trading system is advanced filtering. Even a well-optimized system should not trade all the time. Markets constantly change regimes — trends turn into sideways movement, calm periods explode into high volatility. The purpose of filters is to allow the strategy to trade only when market conditions align with its statistical edge.
Why Filters Are Both Powerful and Dangerous
A filter is an additional logical condition that prevents the system from entering a trade even if the main entry signal has been triggered.
The key question raised by Unger in his work “Filters On The Test Bench” is: when adding a filter improves the equity curve in backtesting, is this a genuine market advantage or simply clever curve-fitting (overfitting)?
Classic Example: Indecision Pattern
Consider a breakout (momentum) strategy that enters on the breakout of a significant level.
Filter: Do not enter a long position if the previous candle closed as a Doji (a candle of indecision where the body is very small: abs(Open - Close) ≤ 0.1 × (High - Low)).
Test Results (Gold futures, daily timeframe, 2015–2024):
| Metric | Without Filter | With Doji Filter | Change |
|---|---|---|---|
| Number of Trades | 487 | 378 | -22% |
| Win Rate | 48.7% | 54.8% | +6.1% |
| Average Trade | +$86 | +$142 | +65% |
| Sharpe Ratio | 0.92 | 1.31 | +0.39 |
| Max Drawdown | -31% | -24% | Improved |
| Profit Factor | 1.41 | 1.78 | +26% |
Visual Comparison: Equity Curves
Blue line — strategy without filter. Green line — with Doji filter. Notice the smoother equity growth and reduced drawdown after applying the filter.
How to Properly Evaluate a Filter’s Effectiveness
A high-quality filter should improve the system across multiple key metrics simultaneously:
- Number of Trades — reduction of no more than 20–35%. A drop of over 50% usually means the filter is breaking the strategy’s logic.
- Win Rate — should increase consistently.
- Average Trade (Expectancy) — the most important metric. It should rise significantly.
- Sharpe / Sortino Ratio — improvement indicates better risk-adjusted performance.
- Profit Factor — ideally above 1.6–1.8 after filtering.
Practical Algorithm for Implementing Filters (Unger’s Approach)
-
Formulate a Clear Logical Hypothesis
Bad approach: “Let’s add RSI and see what happens.”
Good approach: “My strategy works on pullbacks. During extreme volatility (VIX > 28), pullbacks often turn into sharp crashes. Therefore, I will filter entries when the Fear Index is high.” -
Apply the Filter on In-Sample Data
Evaluate changes in all key metrics. Check whether the equity curve has become unrealistically “perfect.” -
Robustness Test (Neighboring Markets)
Apply the same filter without changing parameters to similar instruments (Gold → Silver, ES → NQ, EURUSD → GBPUSD).
If the filter only works on one market, it is likely a random coincidence. -
Out-of-Sample and Walk-Forward Testing
Test the filtered strategy on data the optimizer has never seen. This is mandatory. -
Additional Checks
- Monte-Carlo simulations (bar shuffling)
- Testing across different market regimes (trend, range, crisis)
- Testing on different timeframes
Popular Types of Filters
- Volatility filters (VIX, ATR, Bollinger Band Width)
- Time-based and calendar filters
- Volume and liquidity filters
- Correlation filters
- Indecision patterns (Doji, Inside Bar, Narrow Range)
- Seasonal and session filters
Main Takeaway
A good filter removes structurally bad trades, not just the worst historical losers. It must be based on sound market logic and continue to work on similar assets and timeframes.
If a filter dramatically improves results on In-Sample data but fails on Out-of-Sample or other markets — this is a classic sign of overfitting.
High-quality filtering, combined with proper risk management, is one of the most powerful ways to turn an average strategy into a truly robust trading system.
In the next articles of the series, we will dive deeper into risk management and position sizing.