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 Probability Bounce is a mean-reversion trading strategy built around an anchored VWAP (Volume-Weighted Average Price) and a statistical z-score band. VWAP is the average price an instrument has traded at over a period, weighted by volume, so it reflects where most of the day's business has actually taken place. "Anchored" means the calculation is reset — or re-anchored — to a specific starting point; in this case, the first bar of every new calendar day. The result is a fresh, session-specific fair-value line that many institutional desks use as an execution benchmark.
The core idea is that price tends to gravitate back toward the day's anchored VWAP. When large participants execute orders against a daily VWAP benchmark, they create continuous mean-reverting pressure. This strategy measures how far the current close has stretched away from the anchored VWAP in terms of a volume-weighted sigma (standard deviation), producing a z-score. When price becomes statistically over-extended — and then shows a first snap-back candle — the strategy signals a bounce back toward the mean. It is designed for ranging or low-trend market conditions, where mean reversion is more reliable than in strongly trending sessions.
As a learning tool, this strategy is well suited to traders who want to understand how VWAP, statistical bands, and z-scores combine into a rules-based, mean-reversion framework. It is not a shortcut to results; rather, it is a clear worked example of how anchoring, volume weighting, and reward-to-risk filtering fit together in a single automated system.
How It Works
The strategy acts only once per newly-closed bar and evaluates the most recently completed candle. Here is what happens step by step:
- Re-anchoring: At the first bar of each new calendar day (detected by a change in the bar's UTC date), the VWAP calculation resets. From that anchor forward, each closed bar's typical price — calculated as (High + Low + Close) / 3 — is accumulated together with its tick volume to build the running anchored VWAP.
- Statistical band: Alongside the VWAP, the strategy computes a volume-weighted variance and takes its square root to get sigma. The current close is then converted into a z-score — the number of sigmas the close sits above or below the anchored VWAP.
- Long entry signal: The strategy signals a long when the closed bar's z-score is below
-SigmaMult(stretched below the lower band) and the bar is bullish (close greater than open). This bullish bar is treated as the first snap-back candle back toward the mean. - Short entry signal: The strategy signals a short when the closed bar's z-score is above
+SigmaMult(stretched above the upper band) and the bar is bearish (close less than open). - Take-profit logic: The target for both directions is the anchored VWAP itself — the structural "mean magnet." Because the z-score condition guarantees price is stretched away from VWAP, the target sits on the correct side of the entry.
- Stop-loss logic: The stop is placed an ATR-based distance beyond entry, calculated as
AtrStopMult × ATR(AtrPeriod). ATR (Average True Range) measures recent volatility, so the stop adapts to current market conditions rather than using a fixed distance. - Reward-to-risk filter: Before any order is sent, the strategy checks that the distance to VWAP (reward) divided by the stop distance (risk) meets or exceeds
MinRewardRisk. Setups where VWAP is too close to justify the stop are rejected. - Additional filters: Trades are skipped when the spread exceeds
MaxSpreadPoints, when fewer than two bars exist since the anchor (so sigma would be undefined), and when a position for this magic number is already open. The strategy holds only one position at a time and relies entirely on the stop-loss and take-profit levels to manage exits.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| SigmaMult | 2.0 | 1.0 | 4.0 | Band width as a multiple of the volume-weighted sigma. Lower values give more frequent but noisier signals; higher values give rarer, cleaner ones. |
| AtrPeriod | 14 | 5 | 30 | Lookback period for the ATR used to size the stop-loss distance. |
| AtrStopMult | 1.5 | 0.5 | 4.0 | Stop-loss multiplier. The stop is placed AtrStopMult × ATR beyond the entry price. |
| MinRewardRisk | 0.8 | 0.3 | 3.0 | Minimum reward-to-risk ratio required to take a trade, where reward is the distance to anchored VWAP. |
| MaxSpreadPoints | 80 | 5 | 300 | Maximum allowed spread (in points). Entries are skipped when the spread is wider than this. |
| Lots | 0.10 | 0.01 | 1.0 | Order volume in lots for each trade. |
| Magic | 8841 | 0 | 9,999,999 | Unique magic number used to identify and manage this EA's positions. |

Recommended Chart Settings
This strategy is designed to work on any liquid instrument — FX majors, indices, or commodities — across timeframes from M5 to H1. Because the VWAP re-anchors daily, intraday timeframes give it enough bars to build a meaningful sigma while still resetting cleanly each session. The default parameters are a reasonable starting point for study, but the developer notes that results are historically best in ranging or low-trend regimes. You may wish to filter out high-ADX (strongly trending) sessions externally, since mean-reversion setups tend to underperform when price trends persistently away from the mean. Remember that results will vary across different instruments, brokers, and market conditions, so any settings should be studied on a demo account first.
How to Install on MetaTrader 5
- Download the
.ex5file from the link below. - Copy it to your MT5
MQL5\Expertsfolder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Drag the EA onto a chart matching the recommended symbol and timeframe.
- Configure the input parameters and enable Algo Trading.
What to Consider Before Using This EA
The strengths of this approach lie in its clarity and its structural target. By anchoring VWAP to the daily open, the strategy uses a fair-value reference that many market participants genuinely watch, and its take-profit is a concrete, meaningful level rather than an arbitrary distance. The volume-weighted sigma adapts the band to how much price has actually dispersed during the session, and the ATR-based stop keeps risk proportional to current volatility. The reward-to-risk filter adds a layer of discipline, discarding setups where the potential move to VWAP does not justify the stop.
There are important limitations to understand. Mean-reversion strategies assume price will return to the mean — an assumption that breaks down during strong trends, breakouts, or major news events, when an "over-extended" reading simply keeps extending. In those conditions the strategy may enter early and be stopped out repeatedly. Tick volume, used here in place of true traded volume (which retail forex feeds rarely provide), is only a proxy and can behave differently across brokers. Early in each new day there are few anchor bars, so the sigma estimate is noisier and signals may be less stable. Finally, because only one position is held at a time and exits rely entirely on the stop and target, the strategy will hold through adverse moves until one of those levels is reached. This is an educational framework for studying mean reversion, not a finished system — expect to test, adjust, and validate it thoroughly 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 a small, fixed percentage per trade. Many educators suggest never risking more than 1–2% of account equity on any single position, so that a losing streak does not threaten your capital.
- Size positions to your stop, not the other way around. Let the ATR-based stop distance and your chosen risk percentage determine lot size, rather than trading a fixed lot regardless of volatility.
- Use a demo account first. Test the strategy on historical and live demo data across different instruments and market regimes before considering any real capital.
- Understand drawdown. Every strategy experiences losing periods. Study the depth and duration of potential drawdowns so you know what to expect emotionally and financially.
- Account for costs. Spread, commission, and slippage all erode edge, especially on shorter timeframes — the built-in spread filter helps, but real-world execution still matters.
- Never trade money you cannot afford to lose, and keep automated systems monitored rather than fully unattended.
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
- Expert Advisor: AnchoredVwapProbabilityBounce.ex5 (41 downloads)
- Source Code: AnchoredVwapProbabilityBounce.mq5 (41 downloads)
- Documentation: AnchoredVwapProbabilityBounce.pdf (47 downloads)