Friends - In this Opening Range breakout afl not always signals are generated pls help to correct the mistake in the AFL.
Thanks in advance.
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
breakoutime = 093000;
afterbreakout0 = Cross(TimeNum(),093000);
afterbreakout1 = TimeNum()>=093000;
NewDay = Day()!= Ref(Day(), -1);
highestoftheday = HighestSince(Newday,H,1);
Lowestoftheday = LowestSince(Newday,L,1);
ORBHigh = ValueWhen(afterbreakout0,highestoftheday,1);
ORBLow = ValueWhen(afterbreakout0,lowestoftheday,1);
Plot(C,"",colorGreen,styleCandle);
Range = ORBHigh - ORBLow;
TimeFrameSet(in1Minute);
Buy = Cross(C,orbhigh) AND afterbreakout1;
Sell = Cross(orblow,C) AND afterbreakout1;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short=Cross(C,ORblow) AND afterbreakout1;
Cover=Cross(ORbhigh,C) AND afterbreakout1;
PlotShapes( shapeUpArrow * Buy, colorGreen,0,L,-12);
PlotShapes( shapeDownArrow * Sell, colorRed,0,H,-12);
//Plot(afterbreakout0,"",colorBlue,styleHistogram|styleOwnScale);
Plot(ORBHigh,"",colorGreen,styleDots);
Plot(ORBLow,"",colorRed,styleDots);
Thanks in advance.
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
breakoutime = 093000;
afterbreakout0 = Cross(TimeNum(),093000);
afterbreakout1 = TimeNum()>=093000;
NewDay = Day()!= Ref(Day(), -1);
highestoftheday = HighestSince(Newday,H,1);
Lowestoftheday = LowestSince(Newday,L,1);
ORBHigh = ValueWhen(afterbreakout0,highestoftheday,1);
ORBLow = ValueWhen(afterbreakout0,lowestoftheday,1);
Plot(C,"",colorGreen,styleCandle);
Range = ORBHigh - ORBLow;
TimeFrameSet(in1Minute);
Buy = Cross(C,orbhigh) AND afterbreakout1;
Sell = Cross(orblow,C) AND afterbreakout1;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short=Cross(C,ORblow) AND afterbreakout1;
Cover=Cross(ORbhigh,C) AND afterbreakout1;
PlotShapes( shapeUpArrow * Buy, colorGreen,0,L,-12);
PlotShapes( shapeDownArrow * Sell, colorRed,0,H,-12);
//Plot(afterbreakout0,"",colorBlue,styleHistogram|styleOwnScale);
Plot(ORBHigh,"",colorGreen,styleDots);
Plot(ORBLow,"",colorRed,styleDots);
For changing that change the following lines in your code,
Code:
breakoutime = [B][COLOR="Red"]091500[/COLOR];[/B]
afterbreakout0 = Cross(TimeNum(),[B][COLOR="Red"]091500[/COLOR][/B]);
afterbreakout1 = TimeNum()>=[B][COLOR="Red"]091500[/COLOR][/B];