simple code, (I'm sure I found it here) that plots vertical line at specific times intraday. Just would like to be able to adjust the lineweight. Have tried to add the code (setlineweight) lol.. no joy.
My 1st post here. sorry if it's formatted or posted incorrectly.
#Verticallines_Time_Input_Exists_or_Next_if_Missing
script hl {
input Time1 = 1000;
input ShowTodayOnly = yes;
input price = open;
input rth_only = yes;
def x = if ShowTodayOnly and GetDay() != GetLastDay()
then Double.NaN
else if SecondsFromTime(Time1) == 0
then SecondsFromTime(Time1) == 0 and SecondsTillTime(Time1) == 0
else if SecondsFromTime(Time1) != 0
then (SecondsFromTime(Time1)[1] < 0 and SecondsFromTime(Time1) > 0) or
(SecondsFromTime(Time1) > 0 and
SecondsFromTime(Time1)[1] > SecondsFromTime(Time1))
else Double.NaN;
def xx = if
if rth_only
then if TickValue() == .01
then SecondsFromTime(0900) >= 0 and SecondsFromTime(1600) <= 0
else SecondsFromTime(0900) >= 0 and SecondsFromTime(1700) <= 0
else if TickValue() == .01
then SecondsFromTime(0000) >= 0 and SecondsFromTime(1955) <= 0
else SecondsFromTime(0000) >= 0 and SecondsFromTime(2355) <= 0
then 1
else Double.NaN;
plot xxx = xx and x;
}
input showtodayonly = no;
input price = open;
input rth_only = yes;
DefineGlobalColor("v", Color.blue);
AddVerticalLine(hl(0400, showtodayonly, price, rth_only), "Premarket Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(0300, showtodayonly, price, rth_only), "London Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(0930, showtodayonly, price, rth_only), "Stock Market Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(1600, showtodayonly, price, rth_only), "Market Close", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(1700, showtodayonly, price, rth_only), "Futures Close", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(2000, showtodayonly, price, rth_only), "After Hours Close", GlobalColor("V"), Curve.FIRM);
My 1st post here. sorry if it's formatted or posted incorrectly.
#Verticallines_Time_Input_Exists_or_Next_if_Missing
script hl {
input Time1 = 1000;
input ShowTodayOnly = yes;
input price = open;
input rth_only = yes;
def x = if ShowTodayOnly and GetDay() != GetLastDay()
then Double.NaN
else if SecondsFromTime(Time1) == 0
then SecondsFromTime(Time1) == 0 and SecondsTillTime(Time1) == 0
else if SecondsFromTime(Time1) != 0
then (SecondsFromTime(Time1)[1] < 0 and SecondsFromTime(Time1) > 0) or
(SecondsFromTime(Time1) > 0 and
SecondsFromTime(Time1)[1] > SecondsFromTime(Time1))
else Double.NaN;
def xx = if
if rth_only
then if TickValue() == .01
then SecondsFromTime(0900) >= 0 and SecondsFromTime(1600) <= 0
else SecondsFromTime(0900) >= 0 and SecondsFromTime(1700) <= 0
else if TickValue() == .01
then SecondsFromTime(0000) >= 0 and SecondsFromTime(1955) <= 0
else SecondsFromTime(0000) >= 0 and SecondsFromTime(2355) <= 0
then 1
else Double.NaN;
plot xxx = xx and x;
}
input showtodayonly = no;
input price = open;
input rth_only = yes;
DefineGlobalColor("v", Color.blue);
AddVerticalLine(hl(0400, showtodayonly, price, rth_only), "Premarket Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(0300, showtodayonly, price, rth_only), "London Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(0930, showtodayonly, price, rth_only), "Stock Market Open", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(1600, showtodayonly, price, rth_only), "Market Close", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(1700, showtodayonly, price, rth_only), "Futures Close", GlobalColor("V"), Curve.FIRM);
AddVerticalLine(hl(2000, showtodayonly, price, rth_only), "After Hours Close", GlobalColor("V"), Curve.FIRM);