Different VWAP showing different levels

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #123357 quote
    MajorBasse
    Participant
    Average

    Hello!

    I have been messing around with VWAP and tried different indicators for displaying VWAP Bands. I have realized that all three versions of the VWAP Bands that I have been using shows different levels. The first two I have been using are indicators downloaded from the Forum, and the third one is the built in VWAP Bands indicator that comes as standard with PRT. As you can see in the attached image below, the VWAP is the same but the bands are different. I am a bit confused with which VWAP Bands are actually the correct ones to use?

    VWAP-Support.png VWAP-Support.png
    #123409 quote
    Nicolas
    Keymaster
    Master

    Yes, it has been discussed before about the bands not being calculated the same way as the default VWAP indicator of the platform, I’m sure I have solved that calculation somewhere, let me find the topic.

    #123410 quote
    Nicolas
    Keymaster
    Master

    Here is the code with the same VWAP bands calculation as the default indicator:

    //PRC_VWAP intraday 
    //SAME VERSION AS THE ORIGINAL VWAP FROM THE PLATFORM
    //09.01.2020
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    if day<>day[1] then
    d=0
    else
    d=d+1
    if volume >0 then
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    endif
    sd = std[d](abs(typicalprice-vwap))
    
    SDup1 = vwap+sd
    SDlw1 = vwap-sd
    SDup2 = vwap+sd*2
    SDlw2 = vwap-sd*2
    SDup3 = vwap+sd*3
    SDlw3 = vwap-sd*3
    endif
    
    if vwap>vwap[1] then
    color = 1
    else
    color = -1
    endif
    
    
    RETURN VWAP coloured by color STYLE(LINE,2) as "VWAP", SDup1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 1 STD", SDlw1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 1 STD", SDup2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 2 STD", SDlw2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 2 STD", SDup3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 3 STD", SDlw3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 3 STD"

    Found it in this recent topic: Is there any working intraday VWAP?

    #123452 quote
    MajorBasse
    Participant
    Average

    Excellent! Thank you very much Nicolas!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Different VWAP showing different levels


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
MajorBasse @majorbasse Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by MajorBasse
5 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/26/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...