New to ProRealTime so my questions are probably basic.
- The indicator “MA weighted by volume” is explained as “The MA weighted by volume can be read as an approximation of the average price paid per security”. I thought this should correspond to the VWAP but it doesn’t. Can anyone explain how this “MA weighted by volume” is calculated?
- I got the following cod that was supposed to calculate the VWAP. But to me it just seems to give the price. Could anyone se haw to modify it so that it calculates the VWAP (I know that VWAP is available in 10.3 but I only have vesion 10.2). I want to calculate the VWAP intraday, eg. the weighted average of the closing prices the last 20 days, weighted by volume.
price=close
p=p+1
if day<>day[1] then
p=1
endif
sum=summation[p](volume)
sump=summation[p](price*volume)
ww=sump/sum
return ww
Thanks,
Johan