Blog / Strategy
Strategy

Anchored VWAP Compression 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 Anchored Vwap Compression Breakout is a dual anchored-VWAP squeeze-and-breakout system for MetaTrader 5, built around volume-weighted price analysis and a volatility-scaled breakout trigger. VWAP — short for Volume-Weighted Average Price — is the average price paid for an instrument, weighted by how much volume traded at each price. An anchored VWAP starts that calculation from a specific bar you choose rather than from the beginning of the session, so it tells you the average price paid since a meaningful event. Where most anchored-VWAP methods drop a single anchor and either fade it or ride it, this strategy runs two anchors at the same time and only acts when they agree.

The two anchors are placed automatically. The first, VWAP-Hi, is anchored at the most recent swing high — the highest high in a lookback window — and represents the average price paid by everyone who bought since that top. The second, VWAP-Lo, is anchored at the most recent swing low and represents the average price of everyone who bought since the bottom. When these two averages drift close together, buyers-from-the-top and buyers-from-the-bottom have converged on the same fair value. The market is coiled in a volume-weighted equilibrium — a "squeeze" — and range rarely survives such compression for long.

This is a learning tool for traders who want to study how volume-weighted averages, volatility measurement, and breakout confirmation can be combined into a single rules-based system. It is designed for range-compression conditions that resolve into directional expansion, and it applies distinct long and short logic. Because every calculation is volume-weighted and ATR-scaled, the strategy adapts to different symbols and volatility levels without needing to know a market's point size in advance. It is best suited to intermediate traders comfortable with indicators, backtesting, and disciplined risk management rather than to beginners seeking a hands-off tool.

How It Works

The strategy processes one signal per newly closed bar on the selected timeframe. It maintains rolling buffers of price and tick volume, measures volatility with the Average True Range (ATR) — an indicator that captures the average size of recent bars — and evaluates a strict sequence of conditions before any order is placed.

anchored VWAP breakout MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
AnchorLookback 60 20 200 Number of bars in which to locate the swing high and swing low that anchor the two VWAPs.
CompressionAtrFrac 0.60 0.10 2.50 Maximum gap between the two VWAPs, as a fraction of ATR, for the pair to count as compressed and arm trading.
BreakoutAtrFrac 0.15 0.00 1.00 How far beyond the rail (as a fraction of ATR) the bar must close to confirm the break and filter marginal pokes.
BodyFrac 0.50 0.20 0.90 Minimum breakout-candle body relative to its full range; demands a conviction close.
AtrPeriod 14 5 40 Number of bars used to calculate ATR, the volatility-based distance unit.
AtrStopMult 1.50 0.50 4.00 Stop-loss distance as a multiple of ATR beyond the entry price.
RewardRisk 1.80 0.50 4.00 Take-profit distance expressed as a multiple of the ATR-based risk.
MaxSpreadPoints 120 5 400 Skip new entries when the current spread (in points) is wider than this value.
Lots 0.10 0.01 1.00 Order volume in lots for each new position.
Magic 5307 0 9,999,999 Unique identifier so the EA manages only its own trades.
anchored VWAP breakout MT5 EA — MQL5 source code

Recommended Chart Settings

The Anchored Vwap Compression Breakout is a single-timeframe strategy: every bar read uses the timeframe selected at backtest or run time, so it runs on whatever chart period you attach it to. Its natural home is a liquid market where tick volume is meaningful and spreads stay tight — a major forex pair, gold (XAUUSD), or a stock index — on the M15 to H1 timeframes. These periods tend to produce enough compression-then-expansion cycles for the logic to evaluate without the noise of very low timeframes.

As with any rules-based system, results will vary considerably across symbols, brokers, and market conditions. A configuration that behaves well on one instrument may perform differently on another, so treat the defaults as a starting point for your own study and testing rather than a finished setting.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Every strategy has strengths and limitations, and understanding both is part of using any tool responsibly.

Strengths. The dual-anchor design is conceptually elegant: instead of guessing where equilibrium sits, it lets the two volume-weighted averages converge and signal it directly. Because the compression gate, breakout buffer, and stops are all ATR-scaled, the system adapts to different volatility regimes without manual retuning of point values. The body-fraction and prior-bar-inside conditions are genuine filters that reduce reactions to wicks and marginal pokes, and the spread filter helps avoid costly entries.

Limitations. Breakout systems are prone to false breaks. A market can close clear of a rail, trigger an entry, and then reverse straight back into the range — a "fakeout" — which is one of the most common ways such strategies give back gains. Compression can also persist far longer than expected, and when the break finally comes it may be too abrupt for a clean fill. Because the strategy takes only one position per magic and relies on a fixed reward-to-risk target, it does not trail profits or scale out, so strong trends may not be fully captured. In choppy, low-volatility markets with no clear expansion, signals may be infrequent or whipsaw-prone.

The honest conclusion is that this is a well-structured framework for studying volume-weighted compression and breakout mechanics — not a set-and-forget solution. Forward-testing on a demo account and reviewing how it behaves across varied conditions is essential before drawing any conclusions.

Risk Management Tips

Sound risk management matters 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