I'm trying to get the line to touch the high and low of the candle with the line extending. Like the yellow line does at the mid-point of the candle. I know it's something simple, but I can't figure the code out.
Code:
def last = if isnan(close[-2]) and !isnan(close) then barnumber() else last[1];
def hilo = if hl2 then barnumber() else hilo[2];
def cond = if barNumber() == hilo then barNumber()-2 else double.nan;
def pbar = if barNumber() >= HighestAll(cond) and !last then 2 else double.nan;
input show50 = yes;
plot HalfBack = if show50 and !isnan(pbar) then hl2 else double.nan;
HalfBack.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
HalfBack.SetDefaultColor(color.Yellow);
HalfBack.SetLineWeight(3);
def hbext = if isnan(halfback) then hbext[1] else halfback;
plot hbextline = hbext;
hbextline.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
hbextline.SetDefaultColor(color.Yellow);
hbextline.SetLineWeight(3);
input show75 = yes;
plot Back75 = if show75 and !isnan(pbar) then low+(high-low)*.75 else double.nan;
Back75.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Back75.SetDefaultColor(color.white);
Back75.SetLineWeight(1);
input show25 = yes;
plot Back25 = if show25 and !isnan(pbar) then low+(high-low)*.25 else double.nan;
Back25.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Back25.SetDefaultColor(color.white);
Back25.SetLineWeight(1);
input bubblemover = 1;
def n1 = bubblemover + 1;
input showbubble_candle = no;
input showbubble_expansion = no;
addchartBubble(showbubble_candle and barnumber()==highestall(last-1),high,"H: " +high,color.white,yes);
addchartBubble(showbubble_candle and barnumber()==highestall(last-1),low,"L: " +low,color.white,no);
addchartBubble(showbubble_expansion and isnan(close[bubblemover]) and !isnan(close[n1]),high[n1+1],"H: " +high[n1+1],color.white,yes);
addchartBubble(showbubble_expansion and isnan(close[bubblemover]) and !isnan(close[n1]),low[n1+1],"L: " +low[n1+1],color.white,no);
def h2 = if isnan(close) then h2[1] else high[2];
plot h2p = if barnumber()>=highestall(last) then h2 else double.nan;
h2p.setpaintingStrategy(PaintingStrategy.HORIZONTAL);
h2p.setdefaultColor(color.black);
input showcolor_light_gray = yes;
h2p.assignvalueColor(if showcolor_light_gray then color.black else color.black);
def l2 = if isnan(close) then l2[1] else low[2];
plot l2p = if barnumber()>=highestall(last) then l2 else double.nan;
l2p.setpaintingStrategy(PaintingStrategy.HORIZONTAL);
l2p.setdefaultColor(color.black);
l2p.assignvalueColor(if showcolor_light_gray then color.black else color.black);