the following is a tos script for the opening print of rth...i was wondering if anyone new how to add targets horizental line (or1, or2 ,etc) to this on up and down side.
es futures +15 from opening print and -15 from opening print.
nq futures +65 from opening print and -65 from opening print.
es futures +15 from opening print and -15 from opening print.
nq futures +65 from opening print and -65 from opening print.
Code:
input showOnlyLastPeriod = yes;
def label = yes;
def isOpen = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and GetTime() <= RegularTradingEnd(GetYYYYMMDD());
def firstBarOpen = if isOpen and !isOpen[1] then open else if !isOpen then Double.NaN else firstBarOpen[1];
plot OpeningPrice;
OpeningPrice.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
OpeningPrice.SetDefaultColor(Color.CYAN);
OpeningPrice.SetLineWeight(2);
def shouldHidePlot = showOnlyLastPeriod and !IsNaN(close(period = AggregationPeriod.DAY)[-1]);
if shouldHidePlot {
OpeningPrice = Double.NaN;
} else {
OpeningPrice = firstBarOpen;
}
AddLabel(label, "OP: " + AsDollars(OpeningPrice), Color.CYAN);
Last edited by a moderator: