VWAP in MT5: session anchors, volume sources and reset rules

VWAP in MT5: session anchors, volume sources and reset rules

VWAP needs a price, a weight and an anchor

A volume-weighted average price is the sum of price×volume divided by the sum of volume over a defined interval. A useful implementation must specify which price observations it uses, what “volume” means and where the accumulation starts.

VWAP is not part of the standard built-in indicator list documented for MT5. Custom implementations are available, and they can differ materially. Do not assume that two indicators with the same name use the same session or weighting.

Calculate a small weighted average

With synthetic prices [100,102,101] and weights [10,20,30], the weighted numerator is 1000+2040+3030=6070 and the total weight is 60. VWAP is approximately 101.1667. The ordinary mean is 101, so unequal weights change the result.

If the weights are tick counts and the price is each bar's typical price, describe the result as a tick-volume-weighted bar-price approximation. It is not identical to an exchange calculation from every executed trade.

Make reset rules explicit

A daily reset based on broker midnight can differ from an exchange-session reset or a user-selected anchor. Record the timezone, daylight-saving policy and treatment of breaks. A chart timezone label alone does not guarantee that the indicator uses the same session boundary.

At a new anchor, reset both numerator and denominator. With zero accumulated weight, expose a missing value rather than dividing by zero or carrying the previous session's value without explanation.

Do not add the current bar repeatedly

On every tick, the current bar's price and volume can change. Adding its full cumulative contribution again on each call double-counts it. A simple design stores the completed-bar totals and recomputes the current bar's contribution from its latest values.

When history changes or the anchor moves, rebuild from the defined start. An incremental implementation should match a full pass over the same fixture. Test a session boundary, zero volume and an updated current bar explicitly.

Treat distance from VWAP as a description

Price above VWAP means price is above the selected weighted average under those assumptions. It does not prove that a reversal or continuation is imminent. A different anchor can change that relationship without any new market event.

Before comparing tools, verify their anchor and data contract using the volume-source guide. Then validate the numerical series before adding any trading rule.

Sources and further reading

Back to top
EA reviews4 min

Lizard [MQLume] 2.1: Free source code + free EA | +347,185.50% | 12-month XAUUSD backtest

Get Lizard free: the editable MQL5 source code and compiled MT5 EA are included. Download the package from the product page. Lizard [MQLume] 2.1 recorded a cumulative net return of +347,185.50% in this XAUUSD historical test, with 29.99% maximum relative equity drawdown. Starting capital was USD 5,000; the ending balance was USD 17,364,274.87.

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.7

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping