I am creating a script for myself that plots a Horizontal and a Vertical Line at the Open, and Vertical Lines at 10:00 and another at 15:30 EST. I have used examples here to create what I have, thanks to all of you. I would like to be able to change the color, curve and description in properties Here is the script as far as I have been able to create it. I suspect it is a quick fix for someone who knows the language.
CODE:
CODE:
Code:
# Create Horizontal and Vertical lines at Open. Vertical lines at 9:00 EST and 1530 EST.
def na = Double.NaN;
# open/close times (EST)
input start = 0930;
input end = 1600;
def dayopen = if SecondsTillTime(start) == 0 then 1 else 0;
def daytime = if SecondsFromTime(start) >= 0 and SecondsTillTime(end) > 0 then 1 else 0;
def openbar = if !daytime then na
else if dayopen then open
else openbar[1];
plot ob1 = openbar;
ob1.SetDefaultColor(Color.WHITE);
ob1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ob1.HideBubble();
# AddVerticalLines
input targetTime1000 = 1000;
input targetTime1530 = 1530;
input showverticals = yes;
def tt2 = SecondsFromTime(targetTime1000) == 0;
AddVerticalLine(tt2, " 1st Half Hour", Color.WHITE, Curve.SHORT_DASH );
def tt3 = SecondsFromTime(targetTime1530) == 0;
AddVerticalLine(tt3, " Last Half Hour", Color.WHITE, Curve.SHORT_DASH );
Last edited by a moderator: