didn't work the system out. This 13 bar countdown seems not to render good 
signals in my opinion. The generalized code by Dimitris gives pretty good 
signals. Here is the code a little adjusted with buy,sell signals and buy sell 
price, rgds,Ed


SetBarsRequired(10000,10000);

blp = 0;slp = 0;
for(x=9;x<15;x++) {  

 b2=Sum(C<Ref(C,-4),x)==x;
 bbb = b2==0 AND Ref(b2,-1);
 blp=blp+bbb;
 PlotShapes((shapeHollowSmallCircle)*b2,x);

}

for(x=9;x<15;x++) {  

 s2=Sum(C>Ref(C,-4),x)==x;
 sss=s2==0 AND Ref(s2,-1);
 slp=slp+sss;
 PlotShapes((shapeHollowSmallCircle+shapePositionAbove)*s2,x);
 
}

Buy = blp; BuyPrice = C;
Sell = slp; SellPrice = C;

GraphXSpace = 5;
SetChartOptions(0, chartShowDates);
Plot(C,"\nLast",colorWhite,64);

PlotShapes(IIf(Buy,shapeUpTriangle,shapeNone),colorAqua,0,L,-15);
PlotShapes(IIf(Buy,shapeHollowCircle,shapeNone),colorWhite,0,BuyPrice,0);
PlotShapes(IIf(Sell,shapeDownTriangle,shapeNone),colorYellow,0,H,-15);
PlotShapes(IIf(Sell,shapeHollowCircle,shapeNone),colorWhite,0,SellPrice,0);

Reply via email to