@topmarx, you have misunderstood the indicator and used the wrong values in the parameters.
If you re-read Fries paper’s (try Technical Analysis of Stocks and Commodities June 2001) you will see that he writes “defining the averaging period by volume rather than days. Calculate the volume-weighted moving average over the last trades (or bars, days, weeks, or months) with a total volume of, say, N, where N is a fixed number that has an impact on the length of the averaging period similar to the effect the number of days in other forms of averages has”
So your use of lookback period in bars is wrong
Period = Param("Periods", 15, 2, 300, 1, 10 );
Plot( eVWMA(C, Period )
Even if you were unfamiliar with the indicator your code can illustrate how wrong you are, because in your formula you have
N - Volume. If N is some small number of bars (for example 20) then 20 -3,000,000 (as an example of Volume of 3 million) makes no sense.
result[i] = ((N - Volume[i]) * result[i - 1] + Volume[i] * array[i]) / N;
His paper has this excerpt as well as an example spreadsheet,
I am not an expert on this indicator and have very little familiarity with its use. I have an AmiBroker afl that is one interpretation for this indicator, but I did not write it and had not saved the source so am unable to give proper credit to the author, nor can I confirm that it is the correct interpretation of the Fries work.
// Elastic Volume Weighted Moving Average by Christian B. Fries
// Technical Analysis of Stocks and Commodities June 2001
function eVWMA( array, N )
result = array;
for( i = 1; i < BarCount; i++ )
result[i] = ( ( N - Volume[i] ) * result[i - 1] + Volume[i] * array[i] ) / N;
Price = ParamField( "Price field", -1 );
N = Param( "# of shares multiplier", 1, -100, 100, 1 );
Plot( eVWMA( Price, 10 ^ ( N / 100 ) * LastValue( Highest( Volume ) ) ), "Elastic Volume Weighted Moving Average", colorAqua, styleLine );
If it is of any help the Metastock people coded it this way at that time,
n := Input(“Enter the number of shares: “,1,1000000,1);
eVWMA := ((n-V)PREV+(VC))/n;