this
Description
The Volume Weighted Moving Average (VWMA) is a moving average of prices where the price at any given point over the period is weighted by the volume that ocurred at that particular price. It is calculated by multiplying the price times the volume for a given day, summing these products over the lookback period and dividing the result by the total volume over the lookback period. The result is a moving average that is more responsive on days with higher volume. A text note showing the overlay and color of the overlay is added to the chart in the upper left corner. The most recent value of the VWMA is also shown.



Inputs
p0
is the lookback period for the trailing moving average calculation.

color is normally defined in the plot script program that plots the overlay. EAS colors are designed to rotate through several predefined colors so that if several overlays are plotted on the price chart, they may be discerned from one another. The colors must be input as a character matrix and must be chosen from the set of standard O-Matrix colors.

thk is the thickness of the VWMA line. This parameter is also normally set in the plot script program that plots the overlay. Valid O-Matrix thicknesses are odd numbers.

Output Data & Plotting
returnflag
and plotflag are character inputs that tell fvwma to alternately return data or plot the overlay on the Overlay Pallette. The returned data is a L-row x 1-column matrix, where L is the row dimension of the closing price matrix, cp. The returned data is the value of the VWMA for the period.