Mobius High Relative Volume Bars

Ghost

Member
Is it possible to extend all the lines across the entire chart in this code?


Code:
# High Relative Volume Bars
# Originated By Mobius
# V01.01.2018
# Plots bars with high volume.
# Trading Note: Typically high volume bars are retraced and price will range within the range of that bar for some time before breaking out to a new level. This study plots those bars range as pivots that can be traded as any other pivot study.
input length = 62;
input numDev = 3.0;
input allowNegativeValues = no;
input HighOn = yes;
input LowOn = yes;

def v = volume;
def rawRelVol = (v - Average(v, length)) / StDev(v, length);
def RelVol = if allowNegativeValues
             then rawRelVol
             else Max(0, rawRelVol);
def StDevLevel = numDev;
def h = if RelVol crosses above StDevLevel
        then high
        else h[1];
def l = if RelVol crosses above StDevLevel
        then low
        else l[1];
plot highLine = if highon then h else double.nan;
     highLine.SetPaintingStrategy(PaintingStrategy.Horizontal);
     highLine.SetDefaultColor(Color.Gray);
plot lowLine = if lowon then l else double.nan;
     lowLine.SetPaintingStrategy(PaintingStrategy.Horizontal);
     lowLine.SetDefaultColor(Color.Gray);
 
Top