I'd like a study that simply draws a line since the overnight market open rightwards. I'm using this below script but it's not working as intended:
From the screenshot below you can see that it appears to be functioning correctly but then at 9:30 it jumps up to the market open price. Any insight here?
Code:
def MarketOpenPrice = if SecondsFromTime (0930) == 0 && SecondsTillTime(0930) == 0 then open else marketopenprice[1];
plot Opening_Price = if SecondsFromTime (0000) >= 0 and SecondsFromTime(1700) <= 0 then MarketOpenPrice else Double.NaN;
From the screenshot below you can see that it appears to be functioning correctly but then at 9:30 it jumps up to the market open price. Any insight here?