I written code for breakout signal candle high or low...
but some times signals are repainting.... i post below my code... please correct repaint issues.. Thanks in advance...
I also attached screen shot for your ref..
my code--
Odd=29;
CoefOdd=round(Odd/2);
Even=34;
Coefeven=Even/2;
Coefeven2=Coefeven+1;
CongestionPercent=2.8;
TriangularOdd=MA(MA(C,CoefOdd),CoefOdd);
TriangularEven=MA(MA(C,Coefeven),Coefeven2);
finalMov_avg=IIf(Odd > even,triangularOdd,TriangularEven);
Color=colorBrightGreen;
tickercolor=colorWhite;
Plot(finalMov_avg,"",IIf(C < finalmov_avg,colorRed,Color),styleLine|styleThick);
Plot(C,"",tickercolor,styleCandle);
Bbuy=C > finalmov_avg;
SSell=C < finalmov_avg;
Bbuy=ExRem(Bbuy,Ssell) ;
Ssell=ExRem(Ssell,Bbuy);
shape=bBuy*shapeUpArrow + Ssell*shapeDownArrow;
PlotShapes(IIf(Bbuy, shapeStar, shapeNone),colorGreen, 0, L, Offset=-90);
PlotShapes(IIf(Ssell, shapeStar, shapeNone),colorRed, 0, H, Offset=90);
// entry filter
ex= Param("Entry In %",0.0,0.0,2000,0.10,0);
//ATR(10)/Param("EFA",10,1,20,1,0);
sx=ATR(367)*(Param("SL",2,-10,4,0.5,0));
bBuyPrice=ValueWhen(bBuy,H,1)+ex;
sSHORTPrice=ValueWhen(Ssell,L,1)-ex;
bBuyPrice1=ValueWhen(bBuy,H,1);
sSHORTPrice1=ValueWhen(Ssell,L,1);
YY=EX/100;
EX1=BBUYPRICE*YY;
ENBuyPrice=ValueWhen(bBuy,H,1)+eX1;
EXSHORTPrice=ValueWhen(Ssell,L,1)-ex1;
EHIGH=ValueWhen(bBuy,H);
ELOW=ValueWhen(Ssell,L);
entry=IIf(BarsSince(Ssell)<BarsSince(bBuy), ValueWhen(Ssell,L,1)-ex1,ValueWhen(bBuy,H,1)+ex1);
stop=IIf(BarsSince(bBuy)<BarsSince(Ssell), ValueWhen(bBuy,L,1)-sx,ValueWhen(Ssell,H,1)+sx);
Buy=Cover=Cross(H,entry) AND entry >stop;
Short=Sell=Cross(entry,L)AND entry<stop;
BuyPrice=ValueWhen(bBuy,H,1)+ex1;
SellPrice=ValueWhen(Ssell,L,1)-ex1;
ShortPrice=ValueWhen(Ssell,L,1)-ex1;
CoverPrice=ValueWhen(bBuy,H,1)+ex1;
Buy=ExRem(Buy,Ssell);Short=ExRem(Short,bBuy);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-90);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-80);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-85);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=90);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=80);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-85);![ami|690x316](upload://q4P0hm3zJO4gIOkQagfSgSOd8oi.png)