# Volume Weighted Moving Average

A Volume Weighted Moving Average is a moving average where more weight is given to bars with heavy volume than with light volume. This the value of the moving average will be closer to where most trading actually happened than it otherwise would be without being volume weighted.

Volume weighting can be applied to almost any type of moving average. You could have a a simple volume weighted moving average, an exponential volume weighted moving average, a moving average which is both front weighted and volume weighted or even a volume weighted moving linear regression.

The basic calculation is to apply the moving average (of whatever type) to both price (or whatever else is being averaged) times volume and to just volume by itself. You then divide the moving average of price times volume by the moving average of just volume to get the volume weighted moving average.

Of Closing Prices |
`tAVG(C * V, x) / tAVGVx` |
`t` =MovingAverageType, `w` =Formula, `x` =Period |

Generalized |
`tAVG((w) * V, x) / tAVGVx` |

Where `t`

is the type of moving average. Leave blank for simple, use `X`

for exponential, `F`

for front weighted or `H`

for Hull.

Where `w`

is any formula returning a numeric result.

Where `x`

is the period of the moving average and must be an integer.

### Examples

A 20 period simple volume weighted moving average of price can be written as follows.

`AVG(C * V, 20) / AVGV20`

A 30 period exponential volume weighted moving average of the 20 period Commodity Channel Index (CCI) can be written as follows.

`XAVG((CCI20) * V, 30) / XAVGV30`

A 15 period volume weighted moving linear regression of a 10 period Aroon Oscillator can be written as follows.

`(3 * FAVG((AROONUP10 - AROONDOWN10) * V, 15) - 2 * AVG((AROONUP10 - AROONDOWN10) * V, 15)) / (3 * FAVGV30 - 2 * AVGV30)`