#Highest High during RTH
def h = compoundValue(1,
if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
then high
else max(high,h[1]), h[1]);
def hbn = if GetDay() == GetLastDay()
then if high == h
then BarNumber()
else hbn[1]
else 0;
def hday = if BarNumber() == HighestAll(hbn)
then high
else hday[1];
plot highday = hday;
highday.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#Lowest Low after High of Day
def l = if BarNumber() == HighestAll(hbn + 1)
then low
else Min(low, l[1]);
def lbn = if GetDay() == GetLastDay() and secondsfromtime(1600)<0
then if low == l
then BarNumber()
else lbn[1]
else 0;
def lday = if barnumber()==Highestall(lbn) then l else lday[1];
plot lowday = lday;
lowday.setpaintingStrategy(paintingStrategy.HORIZONTAL);
#Time Bubbles------------------------------------------------------------------------
input showbubbles = yes;
Input showlastbubble = yes;
def hour = Floor(((9 * 60 + 30) + (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000) / 60);
def minutes = (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000 - ((hour - 9) * 60 + 30) + 60;
AddChartBubble(showbubbles and if showlastbubble then barnumber() == highestall(lbn) else lday, lday, lday+"\n"+hour + ":" + (if minutes < 10 then "0" else "") + minutes, Color.white, no);
#