REVE stands for ‘Range Extensions Volume Expansions’. It seeks to report the same as the REVE which I published before. However the code uses a different algorithm to find the ‘usual range’ or ‘usual volume’ to which the current range and volume is compared. In the old REVE a function is coded which mimics a median() function..
In this code the median() function provided in pinescript is used, which makes the code of the actual algorithm nice and short in lines 21 through 27
For example line 23: “morevol=ta.median(curvol[1], usual)*eventnorm” in which
‘morevol ‘ is the calculated level above which the volume is deemed considerable,
‘curvol’ is the current volume (see line 21); curvol[1] the volume of the previous period.
‘usual’ is the lookback period (see line 8)
‘ta.median(curvol[1], usual)’ is therfore the median volume in the lookback period
‘eventnorm’ is the percent which sets when “normal” becomes “considerable” (see line 6)
In line 26 the same is done for range.
The code in lines 30 to 92, concern logic manipulations to arrive at choosing the appropriate marker, which are plotted in lines 95 through 136.
Using the shapes as provided by Pinescript offers the possibility to give a much better and more meaningful visualization of volume and range events than different colored columns and histograms in the ‘old’ REVE in the below panel (see example chart).
Using the Pinescript function to find the median opens the possibility of letting the user play in the inputs with the lookback period and the norms for considerable and excessive to find a setting he or she likes most.
Using median in stead of average is necessary in volume and range analysis because these are so volatile. E.g. range or volume can be 10 times larger in the next period! If you have a few excessive volumes or ranges in the lookback period the ‘average volume or range’ is much higher than the ‘usual volume or range’ In statistics this is referred to as the outlier problem.
The markers are located on the bottom of the instrument pane. Those indicating volume events (with ‘event’ I mean a considerable or excessive expansion or extension) are colored triangles or squares, triangles indicate direction, squares that the price stays the same. those indicating range events with ‘normal’ volume are crosses, plus-cross means considerable range event and x-cross is excessive event.
The red, fuchsia and maroon triangles and squares indicate a combination of volume and range events. I call this ‘effective volume’ because more trade leads to shifting prices. The green and blue triangles and squares indicate a volume event with ‘normal’ ranges. I call this ‘ineffective volume’ because more volume does not lead to price shits. Effective volume can be attributed to occasional traders, because these do not care much for the price effect of their orders. The ineffective volume is attributable to institutional traders, because these go to great length to hide the size of their selling or buying objective by trading many small amounts in a day. Therefore one can theorize that ‘smart money’ is active when green and blue markers show up.
There is an option in the inputs to show markers around the candles (or bars). Those above indicate volume events, plus-cross for considerable and x-cross for excessive volume.
Those below the candles (or bars) indicate range events, triangles for direction or a plus-cross when the price stays the same. The small ones indicate considerable range events and the big ones excessive range events. This option can be used for better understanding of the colors of the bottom markers or to check which marker applies to which candle or bar.
If the instrument is without volume, the indicator will show only range markers.
Have fun and take care.