here is script for opening print during rth...can anyone add script that will add targets on the up and down side...the targets being a horizontal line.
es targets- plus and minus 15 of opening print rth
nq targets plus and minus 65 of opening print rth
es targets- plus and minus 15 of opening print rth
nq targets plus and minus 65 of opening print rth
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: