Blog / Strategy
Strategy

Vertical Horizontal Filter Breakout

Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.

What Is This Strategy?

The Vertical Horizontal Filter Breakout is a regime-gated channel breakout strategy built around the Vertical Horizontal Filter (VHF) — a trend-strength indicator — combined with a classic Donchian channel breakout. In plain terms, it is a trend-following system that tries to enter only when the market is actually trending, rather than chopping sideways. The VHF acts as a gatekeeper: it measures how "directional" recent price action has been and lets the strategy trade a breakout only when that reading is high and improving.

The core idea addresses a well-known weakness of breakout systems: most breakouts fail inside a ranging (choppy) market, where price pokes just past a support or resistance level and then snaps back. The VHF is designed to filter out exactly those conditions. It divides the net directional travel of price by the total distance price actually covered. When price marches steadily in one direction, those two numbers are close and the VHF reads high (trending). When price whipsaws back and forth, the total path is long relative to the net move, so the VHF reads low (choppy).

As a learning tool, this strategy is well suited to traders who want to understand how a filter can be layered on top of a raw entry signal to improve signal quality. It is designed with trending FX majors and index CFDs in mind, on intraday-to-swing timeframes. It is not a "set and forget" money machine — it is a structured, rules-based framework that demonstrates regime detection, ATR-based risk sizing, and trailing-stop trade management in one coherent package.

How It Works

The strategy runs on a single timeframe (whatever chart you attach it to) and evaluates signals only when a bar has fully closed, which avoids the "repainting" problem where a signal appears mid-bar and then disappears. Here is how the logic flows:

Vertical Horizontal Filter breakout EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
VhfPeriod 28 8 60 Lookback length (in bars) for the Vertical Horizontal Filter calculation.
VhfTrendThreshold 0.35 0.20 0.60 Minimum VHF reading (0–1) required to treat the market as trending. Higher is stricter.
VhfSlopeBars 3 1 10 The VHF must be greater than its value this many bars ago (confirms a strengthening trend).
ChannelPeriod 20 5 60 Donchian channel lookback — how many bars before the signal bar define the breakout levels.
BreakoutAtrBuffer 0.10 0.0 1.0 Extra breakout confirmation distance beyond the channel, as a fraction of ATR.
AtrPeriod 14 5 40 Lookback for the ATR used in stops, targets, and trailing.
SlAtrMult 2.0 0.5 5.0 Stop-loss distance as a multiple of ATR.
TpAtrMult 4.0 1.0 10.0 Take-profit distance as a multiple of ATR.
TrailAtrMult 2.5 0.0 6.0 Trailing-stop distance as a multiple of ATR (set to 0 to disable trailing).
Lots 0.10 0.01 1.0 Order volume in lots per trade.
Vertical Horizontal Filter breakout EA — MQL5 source code

Recommended Chart Settings

The Vertical Horizontal Filter Breakout was designed with trending FX majors (such as EUR/USD, GBP/USD, or USD/JPY) and major index CFDs in mind, on intraday-to-swing timeframes — think H1, H4, or D1. Because the system runs on whatever timeframe you attach it to, the same logic can be tested across a range of settings. Higher timeframes generally produce fewer but more deliberate signals, while lower timeframes produce more frequent signals with more noise.

As always, results will vary considerably across different symbols, timeframes, and market conditions. A configuration that behaves well on one instrument during a trending phase may behave very differently during a prolonged range. Treat the defaults as a starting point for study, not a finished configuration.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of this approach. The main design idea — refusing to trade breakouts unless a trend filter confirms directional momentum — directly targets the most common failure mode of raw breakout systems. The ATR-based stops and targets adapt to volatility automatically, and the optional trailing stop is structured to let winners extend while protecting gains. The rules are symmetric for long and short, and signals are evaluated only on closed bars, which reduces false signals from intrabar noise.

Known limitations. The VHF is a lagging indicator: by the time it confirms a strong, rising trend, part of the move may already be behind you. This is the inherent trade-off of any confirmation filter — it improves signal quality at the cost of entering later. Requiring the VHF to be both high and rising can also cause the strategy to sit out entirely during slow, grinding trends that never trigger the threshold.

Where it may underperform. Range-bound and mean-reverting markets are the natural enemy of any breakout system. Even with the filter, whipsaw conditions or sudden reversals right after a breakout can produce a string of losing trades. Sharp news-driven spikes can trigger a breakout entry just before price reverses. The strategy holds only one position at a time per symbol, so it does not pyramid or hedge, and it does nothing to avoid trading around scheduled high-impact news. None of these are flaws to hide — they are simply the conditions under which this style of system historically struggles, and understanding them is part of using it responsibly.

Risk Management Tips

Sound risk management matters far more than any single entry rule. Consider these general principles as you study this strategy:

Risk Warning

Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.

Downloads

← Back to Blog