Trigun1127
Member
Hey guys could someone edit this code so that at a desired bar the High and Low have horizontal lines plotted and that line terminates only when a bar Closes above one or the other?
input Reset_Time = 0930;
declare upper;
declare once_per_bar;
input Length = 10;
def fH =
if !isnan(close[-Length]) then Double.NaN
else if isnan(close[-Length]) and !isNaN(close[-(Length - 1)])
then GetValue(Highest(high,Length),-(Length - 1))
else fH[1]
;
plot H = fh;
H.setpaintingStrategy(paintingStrategy.HORIZONTAL);
H.setdefaultColor(color.red);
def fL =
if !isnan(close[-Length]) then Double.NaN
else if isnan(close[-Length]) and !isNaN(close[-(Length - 1)])
then GetValue(Lowest(Low,Length),-(Length - 1))
else fL[1]
;
plot L = fL;
L.setpaintingStrategy(paintingStrategy.HORIZONTAL);
L.setdefaultColor(color.green);
input Reset_Time = 0930;
declare upper;
declare once_per_bar;
input Length = 10;
def fH =
if !isnan(close[-Length]) then Double.NaN
else if isnan(close[-Length]) and !isNaN(close[-(Length - 1)])
then GetValue(Highest(high,Length),-(Length - 1))
else fH[1]
;
plot H = fh;
H.setpaintingStrategy(paintingStrategy.HORIZONTAL);
H.setdefaultColor(color.red);
def fL =
if !isnan(close[-Length]) then Double.NaN
else if isnan(close[-Length]) and !isNaN(close[-(Length - 1)])
then GetValue(Lowest(Low,Length),-(Length - 1))
else fL[1]
;
plot L = fL;
L.setpaintingStrategy(paintingStrategy.HORIZONTAL);
L.setdefaultColor(color.green);