Think I have worked it out. Seems to work when applied to the chart. Any comments.
LonYOpen = year == 2021 and month == 1 and dayofmonth == 1 and hour == 08 and minute == 00
NYYOpen = year == 2021 and month == 1 and dayofmonth == 1 and hour == 13 and minute == 00
AsiaYOpen = year == 2021 and month == 1 and dayofmonth == 1 and hour == 23 and minute == 00
var LonYOpenPA = 0.0
if LonYOpen
if not LonYOpen[1]
LonYOpenPA := open
// else
// LonWOpenPA := max(open, LonWOpenPA)
var NYYOpenPA = 0.0
if NYYOpen
if not NYYOpen[1]
NYYOpenPA := open
// else
// NYWOpenPA := max(open, NYWOpenPA)
var AsiaYOpenPA = 0.0
if AsiaYOpen
if not AsiaYOpen[1]
AsiaYOpenPA := open
// else
// AsiaWOpenPA := max(open, AsiaWOpenPA)
plot(not LonYOpen ? LonYOpenPA : na, title="London Y Open", color=color.purple, linewidth=4, style=plot.style_linebr)
plotshape(LonYOpenPA, style=shape.labeldown, location=location.absolute, color=color.purple, textcolor=color.white, show_last=1, text="London Y Open", offset = offset_val, transp=20, title="London Y Open")
plot(not NYYOpen ? NYYOpenPA : na, title="New York Y Open", color=color.purple, linewidth=4, style=plot.style_linebr)
plotshape(NYYOpenPA, style=shape.labeldown, location=location.absolute, color=color.purple, textcolor=color.white, show_last=1, text="New York Y Open", offset = offset_val, transp=20, title="New York Y Open")
plot(not AsiaYOpen ? AsiaYOpenPA : na, title="Asia Y Open", color=color.purple, linewidth=4, style=plot.style_linebr)
plotshape(AsiaYOpenPA, style=shape.labeldown, location=location.absolute, color=color.purple, textcolor=color.white, show_last=1, text="Asia Y Open", offset = offset_val, transp=20, title="Asia Y Open")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…