>
> > It is possible to use zigzag in a backtest. the important thing is
> > that the signals can only occur after the price has passed the
> > reversal level
> > eg here is a way to use it
> >
> > p = Peak(C,10);
> > pb = PeakBars(C,10);
> > t = Trough(C,10);
> > tb = TroughBars(C,10);
> >
> > cp = Cross(p*0.9,LowestSince( pb==0, C ));
> > ct = Cross(HighestSince( tb==0, C ), t*1.1);
> >
> > Fall = Flip(Cp,Ct);
> > Rise = Flip(Ct,Cp);
> >
> > Buy = Cross(MACD(),Signal()) AND rise;
> > Sell = Cross(Signal(),MACD());
> >
> > SetChartOptions( 0, chartShowDates|chartWrapTitle );
> > GraphXSpace=10;
> > _N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}} "+_DEFAULT_NAME()+" :
> > {{OHLCX}} {{VALUES}}" );
> >
> > BarColor = IIf( rise, colorPaleGreen, IIf( fall, colorOrange,
> > ParamColor( "Price Colour", colorWhite )));
> >
> > Plot( C, "", BarColor, ParamStyle( "Price Style", styleBar,
maskPrice ) );
> >
> > Plot( Zig(C,10), "Zig", colorRed, styleLine );
> > Plot( IIf(pb<tb,Peak(C,10)*0.9,Trough(C,10)*1.1), "Zig",
> > IIf(pb<tb,colorOrange,colorPaleGreen), styleStaircase );
> >
> > PlotShapes( shapeSmallUpTriangle*Ct, colorPaleGreen, 0, L, -12 );
> > PlotShapes( shapeSmallDownTriangle*Cp, colorOrange, 0, H, -12 );
> >
> > PlotShapes( shapeUpArrow*Buy, colorGreen, 0, L, -24 );
> > PlotShapes( shapeDownArrow*Sell, colorRed, 0, H, -24 );
> >
> > --
> > Cheers
> > Graham Kav
> > AFL Writing Service
> >
http://www.aflwriting.com
> >