Skip to content
All library documents

Building a Daily Session VWAP with Volume-Weighted Deviation Bands

Article MQL5 articles

Summary

The document explains a reusable MQL5 engine for calculating session VWAP and volume-weighted deviation bands. It uses each bar’s typical price, weights it by tick volume, and accumulates values from midnight in broker server time. A two-pass calculation first finds VWAP and then computes weighted variance, producing upper and lower bands. The article describes sharing the same calculation class between a chart indicator and an Expert Advisor, with closed-bar inputs intended to keep signal readings consistent.

The proposed pullback rules look for buys at the lower one-standard-deviation band and sells at the upper band, subject to broader market context. The document argues that volume weighting can represent intraday liquidity better than a simple moving average, but provides no quantitative performance results or comparative tests. The bands are presented as a filter rather than guaranteed support or resistance; trend extensions can cross them. The reset uses calendar midnight, so the session definition depends on broker time, and the example relies on tick volume as its measure of activity.

Key ideas

  • VWAP is calculated from typical prices weighted by each bar’s tick volume.
  • The session accumulation resets at midnight according to broker server time.
  • Weighted variance produces deviation bands that expand and contract with intraday price dispersion.
  • The proposed pullback contract uses closed bars and watches the first deviation bands for entries.
  • The author presents VWAP as a liquidity reference, not a guaranteed reversal level.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.