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??
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?
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"
Thank you Vonasi! It works!