Volume Weighted Moving Average
A plain moving average treats every bar in the window equally. A volume weighted moving average does not: a bar with three times the volume of its neighbours contributes three times as much to the result. On an instrument where volume actually varies meaningfully bar to bar, that makes the line track where the activity was, not just where price was. The honest caveat, stated up front rather than buried: most forex feeds carry no real trade volume at all, because spot FX is decentralised and no single feed sees the whole market. What MetaTrader reports as volume on these symbols is tick count - a proxy for activity, not executed size. This indicator defaults to tick volume for that reason and treats it as what it is, a proxy. An option to use "real" volume exists for instruments that report it (indices, some CFDs, futures-linked symbols); if a broker sends none, the indicator detects that once and falls back to tick volume rather than dividing by a column of zeros. If every bar in a lookback window somehow carries zero volume, the line falls back to a plain unweighted average for that window rather than plotting a gap, since a missing calculation is worse than a briefly unweighted one. Notes and limitations - Tick volume is a count of price updates, not executed size. It correlates with activity but is not a substitute for genuine traded volume, and the weighting this indicator applies is only as meaningful as that proxy. - Recomputes each bar's weighted sum directly from the price and volume arrays rather than maintaining a running total, so the result is always exact even after a history reload; the cost is a loop over InpPeriod bars per recalculation, which is negligible at normal chart sizes. - Not a signal generator by itself - it plots a line, nothing more. Reading it as support/resistance or a cross trigger is a matter of the trader's own method, the same as any moving average.
Indicator · MT5 · v1.0 · Free
About Volume Weighted Moving Average
Volume Weighted Moving Average is an indicator for MetaTrader 5. It has 3 settings, such as Period, Applied price and Use real volume. MQL source code included.
Files in the download: Vwma.ex5, Vwma.mq5, Vwma.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 20 | Averaging period |
| Applied price | PRICE_CLOSE | Applied price |
| Use real volume | false | Use real volume instead of tick volume |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Volume · MT5 Indicator · MQL5 Source Code