VMA

Modified on 2011/10/20 23:26 by Administrator — Categorized as: Standard Indicators

Syntax

public static VMA Series(DataSeries source, int period) public VMA(DataSeries source, int period, string description)

Parameter Description

source DataSeries
period Indicator calculation period

Note!
VMA combines the specified DataSeries with Volume from the current Bars context. Consequently, to calculate VMA for a secondary symbol, first call SetContext(), assign VMA.Series() to a DataSeries variable, and then RestoreContext().

Description

VMA returns the Volume-Weighted Moving Average for the specified Price Series and Period. VMA is similar to a SMA, but each bar of data is weighted by the bar's volume.

VMA places more significance on bars with the largest volume and less for bars with lowest volume for the Period specified. The VMA value attempts to represent the average purchase price of the past number of periods, as it assumes that all prices were traded at selected time (usually the closing value). Using VMA, you can judge if you are buying at a low value or selling at a high value compared to the averaged price paid by all market participants.

Because important breakouts are often accompanied by a large increase in volume, VMA will track aggressive moves more closely than other types of moving averages. During consolidation periods, where volume is light, VMA will act like a normal SMA.

Interpretation


Calculation

VMA = ( V1 * P1 + V2 * P2 + ... + Vn * Pn ) / ( V1 + V2 + ... + Vn )

where,

P1 = current price
P2 = price one bar ago, etc.
V1 = current volume
V2 = volume one bar ago
n = number of periods/bars


Example

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Compare a Volume Weighted Moving Average with a standard MA PlotSeries( PricePane, SMA.Series( Close, 60 ), Color.Blue, LineStyle.Solid, 1 ); PlotSeries( PricePane, VMA.Series( Close, 60 ), Color.DarkGreen, LineStyle.Solid, 2 ); } } }