Tutorial6 min read

Market conditions: teaching a strategy when to stay out

Trend, range, volatility regime. How to describe the market states in which your rules are allowed to act — and when they should stand aside.

Most rules only work in one regime

A moving-average crossover earns its keep in trends and bleeds in ranges. Mean-reversion does the opposite. Defining market conditions is how you stop a strategy from trading in the environment it was never designed for.

Practical filters

Common condition filters include a long-term trend filter (price above or below a 200-period average), a volatility band (ATR within a range), and a participation filter (volume above a baseline).

Each filter you add reduces the number of trades. Fewer, better-qualified trades usually beat more marginal ones once costs are included.

Ready to put this into practice?

Test a strategy in paper trading →

Check it in the backtester

Run the same rules with and without the condition filter over five years. If the filter only improves results in one narrow window, it is probably curve fitting rather than a real regime effect.

M

My Metric Trade Editorial

Published 8 June 2025

← All articles

Try it yourself

Start with paper trading — free, no credit card.