• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Relative Volume StDev Bar as Chart Label

gravityflyer

New member
VIP
Hi all,

I frequently use Relative Volume StDev as an integral part of my trading strategy. Instead of adding the entire lower indicator, I created a simple script that adds an upper bar to my chart:

Si0pXZm.png


Code:
# RelativeVolumeStDev_Bar
# Author: gravityflyer
# v1.0 - 2021.04.18

declare upper ;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

plot labelColor=double.nan;
labelColor.setHiding(1);
labelColor.hideTitle();
labELColor.defineColor("Unchanged", color.GRAY);
LabelColor.DEFIneColor("Rising", color.UPTICK);

def bar = (volume - Average(volume, length)) / StDev(volume, length);
AddLabel(1, Concat(Concat(Concat("RelVol(", length), "):"), bar),
  if bar > 0 then
    labelColor.color("Rising")
  else
    labelColor.color("Unchanged")
);

I figured I'd share in case someone else finds it helpful! :)
 

gravityflyer

New member
VIP
May i ask how you use it for your trading strategy?
Personally, I use it as additional confirmation with my other indicators and avoid fake-outs.

That said, I believe there are a lot of different ways in which traders use relative volume more generally!
 

Similar threads

Top