Is there any working intraday VWAP?

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #115123 quote
    axellus
    Participant
    Junior

    Hello,

    I am trying different VWAP indicators but none of them seem to work. For example when I try https://www.prorealcode.com/prorealtime-indicators/vwap-intraday/ I get the result i attached in this post.
    I’ve tried other VWAP indicators and all of them give very strange results similiar to that one.

    I would really appriciate getting a VWAP indicator with bands to work.

    Best regards,

    N123123.png N123123.png
    #115142 quote
    Nicolas
    Keymaster
    Master

    There is a built-in VWAP bands in the indicator list of the platform.

    I think that the indicator you refer to has a problem of calculation for the bands when the volumes are not present. Here is a quick fix:

    //PRC_VWAP intraday
    //07.09.2016
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    d = max(1, intradaybarindex)
    
    if volume>0 then 
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    if(intradaybarindex=0) then
    sd = vwap
    else
    sd = SUMMATION[d](max(abs(high-vwap),abs(vwap-low)))/d
    endif
    endif
    
    SDup1 = vwap+sd
    SDlw1 = vwap-sd
    SDup2 = vwap+sd*2
    SDlw2 = vwap-sd*2
    SDup3 = vwap+sd*3
    SDlw3 = vwap-sd*3
    
    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"
    ProRealJMSB and poldoposta thanked this post
    #115157 quote
    axellus
    Participant
    Junior

    Hello Nicolas,
    This seems to be working a lot better. Thank you for your quick and reliable help.
    You contribute a great deal to this community, keep up the good work.

    I will write again if I have any more questions 🙂

    Thank you

    #115159 quote
    axellus
    Participant
    Junior

    Hello again,

    So now I get this result (see attachment), which is better but I still have one or two questions.

    Why do the bands spike up and down like crazy right at the beginning of the day? Now I have the chart time only during open hours 09.00-17.30.
    Also second question, is it suppose to differ this much comapred to the built in VWAP bands in PRT? I want to use it for algo trading so I cannot use the built in one.

    Best regards,

    Namnlös123123.png Namnlös123123.png
    #115164 quote
    Vonasi
    Moderator
    Master

    Why do the bands spike up and down like crazy right at the beginning of the day?

    Because at the beginning of the day you don’t have much data to base the calculations on so each bit has a far larger effect than at the end of the day At the end of the day you have lots of data and so a new bit of data has little overall effect unless it is extremely different to all that came before it.

    #115169 quote
    Nicolas
    Keymaster
    Master

    After unsuccessful attempts to reverse engineer the bands calculation from the built-in indicator, I sent an email to ITF to know how they calculate it. I let you know once I get a reply.

    #115179 quote
    axellus
    Participant
    Junior

    Okey, thank you so much for the help and answers.

    #115779 quote
    axellus
    Participant
    Junior

    Hello Nicholas, hope you have had nice and relaxing holidays.

    Any news on the vwap indicator?

    Best regards,

    Axel

    #116011 quote
    Nicolas
    Keymaster
    Master

    Not yet, will let you know. I made a reminder 😉

    #116309 quote
    Nicolas
    Keymaster
    Master

    with the help of PRT, we finally recode it to be perfectly the same as the one from the platform, here is the VWAP code:

    //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"

    Make sure to have sufficient bars on your chart for the calculation to perfectly match the original VWAP indicator.

    Vonasi, PLermite, keks, MobiusGrey and poldoposta thanked this post
    #117851 quote
    axellus
    Participant
    Junior

    Awesome Nicolas

    #150538 quote
    BizzTrade
    Participant
    New

    Hi Nicolas

    Is there a way to have the above VWAP indicator commence/reset at 10:00am (UTC +11:00) each day?

    Kind regards

    Ben

    #158591 quote
    screbassa
    Participant
    Average

    Hi Nicolas,
    With the code you published, the VWAP is now almost similar to the native indicator in PRT (there are still some minor discrepencies I don’t understand).
    However, the bands remain totally different. My point is that I prefer the native indicator bands rather than the standard deviations bands you coded. Do you have more information about the way they coded these bands?

    Thanks.

    #158639 quote
    Nicolas
    Keymaster
    Master

    @BizzTradeTime Anchored VWAP

    or VWAP Date & Time Anchored


    @screbassa
    I’m trying to understand why it doesn’t look the same as before in v11 and let you know..

    screbassa thanked this post
    #166785 quote
    stefou102
    Participant
    Veteran

    Hello Nicolas,

    Have you found why your custom code for the vwap bands and the native indicator doesn’t match? I think there are bugs at least when there is no volume in the CFD at some part of the day (holidays, or before future openings). See for example the 6 April on Dax CFD “Allemagne 30 Cash (5€)”

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

Is there any working intraday VWAP?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
axellus @axellus Participant
Summary

This topic contains 18 replies,
has 6 voices, and was last updated by Nicolas
3 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/17/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...