Relative volume is an important indicator in intraday trading. PRT does not include this indicator however. I have tried to program some sort of relative volume indicator using the EstimatedVolume function but this function assumes volume is added in a linear fashion which is not true since stocks generally have much more volume close to the open than later on. I currently use this in my intraday screeners :
It occurs to me that perhaps the intradaybar index can be used for this much like Nicholaus used it for the intraday VWAP.
I tried this:
d = max(1,intradaybarindex)
d1=SUMMATION[d](volume)
d2=average[30](d1)
relvolume=d1/d2
RETURN relvolume as “relvol”
But it does not look right on the charts. The relative volume is too low at the opening bars even on stocks that I know had high relative volume at the open. For this to work d1 and d2 would have to be calculated on the same bar. I have a feeling this is not happening. Any ideas?
>> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
I think that the code is not using the first bar volume when intradaybarindex=0.
Try this amended code:
if intradaybarindex=0 then
first=volume
endif
d = max(1,intradaybarindex)
d1=first+SUMMATION[d](volume)
d2=average[30](d1)
relvolume=d1/d2
RETURN relvolume as “relvol”
The following formula:
if intradaybarindex=0 then
first=volume
endif
d = max(1,intradaybarindex)
RV=first+SUMMATION[d](volume)
Gives a nice graphical depiction of intraday volume as it accumulates on an intraday chart. What I am trying to accomplish is to find this formula to get this same calculation for the previous day and for the day before and so on. Then I could get a ratio of the volume compared to an average as it accumulates on the chart. I am very confused trying to apply some of the time functions as they do not seem to work in this instance or maybe my syntax is not quite right. I tried this:
while Openday[1]
e= max(1,intradaybarindex)
RV1=SUMMATION[e](volume)
wend
RETURN RV1 as "RV"
But it just plots as a null value. Are there any time functions that can be used with the intradaybarindex function?