Adjust VWAP indicator

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #115427 quote
    Marcel van Vliet
    Participant
    Veteran

    Hi team,

    The big advantage with the regular VWAP indicator is that the price generated is the same on every time frame. However, this is not the case with the VWAP indicator of PRT. Is it possible to adjust the code below to show the same price on every time frame, or to write a new code for this indicator?

    Thank you

    //VWAP
    d = 20
    
    vw = volume*close
    vwsum = SUMMATION[d](vw)
    volsum = SUMMATION[d](volume)
    vwap = vwsum/volsum
    
    ///////////////////////
    
    cc = customclose
    
    RETURN vwap AS "VWAP" , cc as " customclose "
    
    #115518 quote
    Marcel van Vliet
    Participant
    Veteran

    Anybody? …….

    All the guys who helped me multiple times before: #Grahal, #Nicolas, #robertogozzi, #Vonasi

    #115521 quote
    GraHal
    Participant
    Master

    I think they are all hungover Marcel !? 🙂

    Might you be able to show screen shots of what you mean?

    I copied and pasted the above indicator and from what I deduct the Price that shows for a respective Timeframe is the mid price for that Timeframe? Is that not what you would expect to get anyway??

    • If you are on 1 min TF then over a 5 min period you would see 5 x mid prices?
    • If you are on 5 min TF then over a 5 min period you would see 1 x mid price?
    Marcel van Vliet thanked this post
    #115522 quote
    GraHal
    Participant
    Master

    Correction to above post:

    • For ‘mid’ price read ‘VWA’ price
    #115523 quote
    GraHal
    Participant
    Master

    Is attached what you mean?

    1st image is 5 min TF and 2nd image is 1 min TF.

    They are different by 0.001 ??

    Marcel van Vliet thanked this post
    5-min.jpg 5-min.jpg 1-min.jpg 1-min.jpg
    #115529 quote
    Vonasi
    Moderator
    Master

    The built in PRT indicator takes tick by tick data and calculates a moving average of price taking into account the volume of each tick. It does this either day by day or on a sliding period of x minutes.

    As we cannot currently use multiple time frames in ProBuilder it is not possible to replicate the same thing.

    #115530 quote
    Vonasi
    Moderator
    Master

    I coded something a long time ago that detected what time frame chart we were using (I think Roberto has also coded something similar) so it might be possible to use that code and then set a period of x candles based on what time frame it detects. It probably wouldn’t match the built in VWAP exactly as on faster time frames missing candles will mess up the calculation as ProBuilder will still count missing candles as a candle!

    Marcel van Vliet thanked this post
    #115563 quote
    Marcel van Vliet
    Participant
    Veteran

    Thanks for your help.

    What I mean with the VWAP is that the price shows the same on every time frame the same as it does with the Tradestation code in the article included.

    When I switch from the D1 to the H1 or H4 timeframe, Tradestation shows (almost) the same price for VWAP.

    Intraday-VWAP-Indicator-with-RadarScreen.pdf
    #115648 quote
    Marcel van Vliet
    Participant
    Veteran

    Hi Vonasi,

    Will you please sent me your code, so I can adjust and build further on from that. If you don’t want it displayed in public, you can sent it to me in an email.

    *******@gmail.com  (Moderators edit: email address deleted)

    Thank you.

    #115652 quote
    Vonasi
    Moderator
    Master

    You can find the chart time detection code here:

    Determine the charts time frame in a program

    It is not advised to post your email address in the forums – I will delete it from your post.

    Marcel van Vliet thanked this post
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Adjust VWAP indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/23/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...