Discrepencies VWAP

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #97927 quote
    stefou102
    Participant
    Veteran

    Hello,

    I have several screeners running around stocks crossing the VWAP indicator intraday, but I have always noticed some false results.

    Now that I’m looking closer, I see there is a discrepency between the VWAP indicator built in the platform, and the VWAP code I use in my screeners, since apparently I can not call the built-in indicator.

    So in my screener, I calculate the VWAP as followed:

    d = max(1, intradaybarindex)
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)

    As you can see in the image attached, if I compare this code the the built in indicator, the shape is the same, but there is a slight shift…

    Do you know why? is there a way to call the built in indicator?

    Capture-1.png Capture-1.png
    #97940 quote
    Vonasi
    Moderator
    Master

    There are a couple of issues. Your VWAP is inaccurate at the start of a day as it gives d a value of 1 for the first two bars. Try this instead:

    d = intradaybarindex + 1
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    
    return vwap

     

    Also if you read the description of the built in VWAP you will see that it is calculated using tick by tick data whereas yours is calculated using minute chart data. This is the most likely reason for the differing values.

    Also bear in mind that when using the calculation in a screener that a screener can only use 254 bars and there are possibly 1440 bars in a day on a minute chart so this might give you incorrect screener results.

    Screenshot_6.png Screenshot_6.png
    #97984 quote
    stefou102
    Participant
    Veteran

    Thx you very much Vonasi, always here to help. your remark about “d” is already reducing strongly the shift, and the rest is indeed a matter of timeframe (I had already noticed it). For guys trading stocks, VWAP is the most important indicator, with lot of continuation bets that can be taken once the price has found support/resistance on it.

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

Discrepencies VWAP


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
stefou102 @stefou102 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by stefou102
6 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/08/2019
Status: Active
Attachments: 2 files
Logo Logo
Loading...