Hi,
I have found code of VWAP for intraday with a starting time, but I am unable to amend it to get a sliding VWAP as per the attached snapshot.
Is it possible to compute something like?
// VWAP Computation
Timestart=Time-010000
if time=Timestart then
d=0
else
d=d+1
if volume >0 then
VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
endif
endif
Thanks for your help
JSParticipant
Senior
Hi @KumoNoJuzza
Try this one:
SlidingPeriod = 120 //in minutes
GTF = GetTimeFrame
N = Round(SlidingPeriod / (GTF/60))
VW = Close * Volume
VolumeSum = Summation[N](Volume)
VolumeWeightedSum = Summation[N](VW)
VWAP = VolumeWeightedSum / VolumeSum
Return VWAP Coloured("Red")