VWAP Date & Time Anchored

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

    Hi to everyone! I know the VWAP Date Anchored from the library, and also the intraday VWAP indicator. But, I want to combine all into one. I want to have the option on settings to select specific date in the past and also specific time of that selected date. Can anyone help me with this please??

    #137232 quote
    Geons
    Participant
    Average

    With some modifications I made this :

    // --- settings
    //startDate = 20161212
    //startTime = 123000
    // --- end of settings
    
    VWAP=undefined
    
    if opendate=startDate and opentime=starttime then
    startbar=barindex
    
    endif
    
    
    if opendate>=startDate then
    barcount=barindex-startbar
    
    
    
    d = max(1, barcount)
    
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    
    endif
    
    RETURN VWAP as "VWAP D+T"

    But, I can’t find a way to start VWAP from the specific time of the day. In my code the indicator prints a zero line from the start of the Date, and calculates VWAP from the start time. Can someone helps with this please?

    #137237 quote
    Vonasi
    Moderator
    Master

    Perhaps something like this?

    // --- settings
    startDate = 20161212
    startTime = 120000
    // --- end of settings
    
    VWAP=undefined
    
    if opendate=startDate and opentime=starttime then
    startbar=barindex
    flag = 1
    endif
    
    if opendate>=startDate and flag then
    barcount=barindex-startbar
    d = max(1, barcount)
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    endif
    
    RETURN VWAP as "VWAP D+T"
    Geons, Nicolas and snucke thanked this post
    #137241 quote
    Geons
    Participant
    Average

    Thank you Vonasi! It works!

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

VWAP Date & Time Anchored


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Geons @geons Participant
Summary

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

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