my code is as below
_SECTION_BEGIN("breakoutsystem 81");
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
kTop = MA(C,20)+2 * ATR(20);
KBot = MA(C,20) -2* ATR(20);
d=BarsSince(C>ktop);
p=BarsSince(C<kbot);
Buy=p-d>2;
Sell=d-p>2;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=Sell;
Cover=Buy;
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorCustom11, colorCustom12), 0, IIf( Buy, Low, High ) );
// price plot
Plot( C, "Close", colorDefault, styleBar );
Moderator comment: you need to use CODE TAGS as per forum rules. How to use this site
do u find any loop function?