MA and VWAP?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11201 quote
    johbrijohbri
    Participant
    New

    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 quote
    NicolasNicolas
    Keymaster
    Legend

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

    #11213 quote
    johbrijohbri
    Participant
    New

    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
    Dok1.docx
    #11230 quote
    NicolasNicolas
    Keymaster
    Legend

    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)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

MA and VWAP?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
johbri @johbri Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
10 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/04/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...