MA and VWAP?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #11201

    New to ProRealTime so my questions are probably basic.

    1. 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?
    2. 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

     

    #11203

    Are you sure that the tested instrument with this indicator has volume informations?

    #11213

    Hi Nicolas,

    1. Please see attached file where I used the script above.
    2. But I’ve found a useful script in the forum “VWAP bands” which I think is correct.
    3. I’m still curious what the “MA weighted by volume” represents
    #11230

    The result you get is normal, since you divide the Volume by the Volume, so you get the price only.

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login