Darth Tradicus
Member
Hello, trying to plot horizontal lines at the high and low of the first 1 hour period that the market is open. Probably best if the lines appear at the one hour mark but don't mind if they move with the price till then- just need them to stay in one place after the 1st hour. Found some code searching around on the boards but not sure how to plot the lines with these conditions.
Code:
input startTime = 0930;
input endTime = 1030;
def Active = SecondsFromTime(startTime) >= 0 and SecondsTillTime(endTime) >= 0;
def HighFirst60Min = if Active and !Active[1]
then high
else max(high, HighFirst60Min[1]);
def LowFirst60Min = if Active and !Active[1]
then low
else max(low, LowFirst60Min[1]);