#So if I want a line at 2am, 5am, 8am and 9am on Monday.
#Then Tuesday one at 3am, 6am, 9am and 10am.
input price = close;
input extendlines = yes;
input time0200 = 0200;
input time0300 = 0300;
input time0500 = 0500;
input time0600 = 0600;
input time0800 = 0800;
input time0900 = 0900;
input time1000 = 1000;
def bn = BarNumber();
#Monday's Lines
def Monday = if GetDayOfWeek(GetYYYYMMDD()) == 1 and SecondsFromTime(1800) > 0
then Double.NaN
else if GetDayOfWeek(GetYYYYMMDD()) == 1
then 1
else Double.NaN;
def Line0200 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0200) == 0 then price else Double.NaN;
def Bar0200 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0200) == 0 then bn else Double.NaN;
plot Monday_Line0200 = if bn >= HighestAll(Bar0200) then HighestAll(Line0200) else Double.NaN;
def Line0500 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0500) == 0 then price else Double.NaN;
def Bar0500 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0500) == 0 then bn else Double.NaN;
plot Monday_Line0500 = if bn >= HighestAll(Bar0500) then HighestAll(Line0500) else Double.NaN;
def Line0800 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0800) == 0 then price else Double.NaN;
def Bar0800 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0800) == 0 then bn else Double.NaN;
plot Monday_Line0800 = if bn >= HighestAll(Bar0800) then HighestAll(Line0800) else Double.NaN;
def Line0900 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0900) == 0 then price else Double.NaN;
def Bar0900 = if GetWeek() == GetLastWeek() and Monday and SecondsFromTime(time0900) == 0 then bn else Double.NaN;
plot Monday_Line0900 = if bn >= HighestAll(Bar0900) then HighestAll(Line0900) else Double.NaN;
#Monday's Lines
def Tuesday = if GetDayOfWeek(GetYYYYMMDD()) == 2 and SecondsFromTime(1800) > 0
then Double.NaN
else if GetDayOfWeek(GetYYYYMMDD()) == 2
then 1
else Double.NaN;
def L0300 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0300) == 0 then price else Double.NaN;
def B0300 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0300) == 0 then bn else Double.NaN;
plot Tuesday_Line0200 = if bn >= HighestAll(B0300) then HighestAll(L0300) else Double.NaN;
def L0600 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0600) == 0 then price else Double.NaN;
def B0600 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0600) == 0 then bn else Double.NaN;
plot Tuesday_Line0600 = if bn >= HighestAll(B0600) then HighestAll(L0600) else Double.NaN;
def L0900 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0900) == 0 then price else Double.NaN;
def B0900 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time0900) == 0 then bn else Double.NaN;
plot Tuesday_Line0900 = if bn >= HighestAll(B0900) then HighestAll(L0900) else Double.NaN;
def L1000 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time1000) == 0 then price else Double.NaN;
def B1000 = if GetWeek() == GetLastWeek() and Tuesday and SecondsFromTime(time1000) == 0 then bn else Double.NaN;
plot Tuesday_Line1000 = if bn >= HighestAll(B1000) then HighestAll(L1000) else Double.NaN;
#