- Strategy
- Buys when a bar closes more than k standard deviations below the daily VWAP and turns up, and sells when a bar closes more than k deviations above VWAP and turns down. The take-profit is VWAP itself.
- Risk model
- 1% of balance per trade (configurable), ATR-based stop-loss on every order, one position at a time, optional end-of-day exit
What it does
VWAP (volume-weighted average price) is the average price of the day weighted by activity. VWAP Reversion EA treats it as the day's fair value: when price is stretched far away from it, the EA bets on a move back toward it, and it closes everything by the end of the trading window.
How it works
VWAP resets at the start of each server day. For every closed bar of the day the EA takes the typical price (high + low + close) ÷ 3 and weights it by the bar's tick volume, because spot forex has no central exchange volume:
- VWAP = Σ(typical price × volume) ÷ Σ(volume)
- Deviation = square root of [Σ(typical price² × volume) ÷ Σ(volume) − VWAP²]
On every new bar, once at least 12 bars of the day exist:
- Buy: the last close is below VWAP − 2 × deviation and, with the reversal option on, the bar closed above its open.
- Sell: the last close is above VWAP + 2 × deviation and the bar closed below its open.
- Stop-loss: 1.5 × ATR(14) from entry. Take-profit: the VWAP value at the signal.
- Reward check: skipped if VWAP is closer than 0.8 × the stop distance.
- Time exit: any open trade is closed when the trading hours end.
The EA refuses to start on charts above H1, because a daily VWAP needs intraday bars.
How to use it
Run it on M5 to M30 during liquid hours. With the default 8–20 server-time window it skips the thin hours around the daily reset. Stretched moves on news days often keep going, so many traders also avoid high-impact releases on the Economic Calendar. The forex sessions lesson explains why activity changes through the day.
Settings
| Input | Default | What it changes |
|---|---|---|
| Entry band k | 2.0 | How stretched price must be |
| Bars of the day required | 12 | Warm-up after the daily reset |
| Reversal candle required | true | Confirmation of the turn |
| ATR period / Stop-loss (x ATR) | 14 / 1.5 | Stop size |
| Min reward vs stop | 0.8 | Skips setups with a close target |
| End-of-day exit | true | Flattens at the end hour |
| Risk per trade / Fixed lots | 1.0% / 0 | Position sizing |
| Max spread (points) | 30 | Spread filter |
| Trading start / end hour | 8 / 20 | Server-time window |
| Break-even / Trailing | on / off | Stop management |
Limitations
Tick volume is only a proxy for traded volume. The VWAP resets at the broker's server midnight, which may not match the session you care about. On trend days price can stay beyond the band for hours. The target is fixed at entry while VWAP keeps moving.
Before you run it live
Test it in the Strategy Tester with real-tick data, because intraday results are very sensitive to spread, then on a demo account. Confirm your broker's server time, set the trading window accordingly and keep the risk per trade small. Past behavior does not guarantee future results.

