Volume Weighted Moving Average Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

A volume weighted moving average gives busy bars more say than quiet ones. The volume weighted moving average indicator builds a 20-bar and a 50-bar VWMA from tick volume, colours the fast line green or red by its slope, and marks the bar where the fast line crosses the slow one.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 5: VWMA Up, VWMA Down, VWMA Slow, VWMA Buy, VWMA Sell
Alerts popup, push notification, email, sound
Inputs 9

On screen

Three line colours and two marks on price.

`VWMA Up` draws the fast line lime while it rises.

`VWMA Down` draws it red while it falls.

`VWMA Slow` draws gold at width 2.

`VWMA Buy` prints aqua with arrow 233.

`VWMA Sell` prints magenta with arrow 234.

  • VWMA Up: line, lime, width 2
  • VWMA Down: line, red, width 2
  • VWMA Slow: line, gold, width 2
  • VWMA Buy: arrow, aqua, width 2, arrow code 233
  • VWMA Sell: arrow, magenta, width 2, arrow code 234
volume weighted moving average indicator: Fast and slow VWMA with cross marks, EURUSD H1.
Fast and slow VWMA with cross marks, EURUSD H1.

What happens on each bar

Weighting

Each close is multiplied by its tick volume. The sum over the window, divided by total volume, is the VWMA.

Two lines

`FastPeriod` `20` gives the coloured line and `SlowPeriod` `50` the gold one. Set the slow period to zero to compare price with the fast line instead.

Crosses

A buy prints where the fast line moves above the slow line. The sell is the mirror.

Making sense of the output

Lime segments mean the fast VWMA is rising.

Red segments mean it is falling.

Aqua marks show fast-over-slow crosses.

Magenta marks show the reverse.

`ArrowGapPts` `8` spaces the marks.

Warm-up needs about fifty bars.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

Crosses of the two lines report once per closed bar. `EnableAlerts` controls them, and only popup delivery is on at the start.

Every Volume Weighted Moving Average Indicator input

Core settings

Setting What it does Default
FastPeriod Fast VWMA period. Fast VWMA length, `20`. 20
SlowPeriod Slow VWMA period (<=0 -> price/VWMA cross). Slow VWMA length, `50`. 50

Display settings

Setting What it does Default
ArrowGapPts Arrow offset from bar (points). Mark gap in points, `8`. 8

Alert settings

Setting What it does Default
EnableAlerts Master alert switch, `true`. on
EnablePopup Popup, `true`. on
EnablePushNotify Phone route, `false`. off
EnableEmail Email route, `false`. off
EnableSound Speaker, `false`. off
SoundFile Speaker clip, `”alert.wav”`. alert.wav
volume weighted moving average indicator: Inputs panel, the two VWMA lengths.
Inputs panel, the two VWMA lengths.

Where to point it

Tick volume exists on every forex chart. On the hourly EURUSD screenshot the lines cross every few days. On M15 session volume shapes them more, and on D1 they follow weekly swings.

What can go wrong

Tick volume only approximates real volume.

Crosses lag the turn.

Quiet sessions weigh little and shift the lines slowly.

Only popup delivery starts switched on.

Copy the compiled Volume Weighted Moving Average Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Related on forexmt4systems.com: Moving Average Crossover Strategy.

Download the Volume Weighted Moving Average Indicator for MT4 and MT5

The zip holds the compiled Volume Weighted Moving Average Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

How is a VWMA different from a simple average?

A simple average treats every close the same. A VWMA multiplies each close by its tick volume first, so busy bars pull the line harder than quiet ones.

What happens with SlowPeriod set to 0?

The slow line is switched off, and marks compare price with the fast line instead. A close crossing above the fast VWMA then prints the buy mark.

What does the VWMA Up colour show?

That the fast line rose from the previous bar. The colour follows the slope only, while crosses with the slow gold line produce the aqua and magenta marks.

Why use FastPeriod 20 and SlowPeriod 50?

They are common trend lengths that cover about a day and a half and about two and a half days on hourly charts, giving clear, not-too-frequent crosses.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Volume Weighted Moving Average Indicator as one input. Always backtest before trading live.

Category: this is part of our Trend collection. Browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment