[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Volume weighted average



PureBytes Links

Trading Reference Links

This isn't exactly like Arms' implementation and also isn't the most
efficient code but here's a simplified version (unverified) that
demonstrates the concept. Basically, you are giving more weight to the
price on bars with heavier volume.

{function: volume_weighted_average}

input: price(numeric), period(numeric);
var: price_vol(price*volume), avg(price);

price_vol = price * volume;
avg = summation(price_vol,period) / summation(volume,period);

volume_weighted_average = avg;

-- 
  Dennis