Thanks guys, but I'm looking for the code for the ZigZag function itself (not a strategy that uses the Zig function).
--- In amibroker@xxxxxxxxx ps.com, "corvidsystems" <corvidsys@x ..> wrote:
>
> Hope this helps:
> ------------ --------- --------- --------- -----
> Opt1 = Param("%Zig( Change)", 0.1,0,1,0. 05);
> Opt2 = Param("Min.Allowabl eDuration" ,1,1,20,1) ;
> Z = Zig(C,Opt1);
> Buy = Z < Ref(Z,1) AND Z < Ref(Z,-1);
> Sell = Z > Ref(Z,1) AND Z > Ref(Z,-1);
> Buy = Buy AND BarsSince(Sell) > Opt2;
> Sell = Sell AND BarsSince(Buy) > Opt2;
> Short = Sell;
> Cover = Buy;
> Eq = Equity(1);
> Plot(C,"",colorBlac k,styleBar) ;
> Plot(z,"",colorWhit e,styleLine) ;
> ShowTriangles = ParamToggle( "Arrows",
"HIDE|SHOW" ,1);
> if(showTriangles)
> {
> PlotShapes(IIf( Buy,shapeSmallUp Triangle, shapeNone) ,5,0,BuyPrice, 0);
> PlotShapes(IIf( Sell,shapeHollow DownTriangle, shapeNone) ,4,0,SellPrice, 0);
> PlotShapes(IIf( Cover,shapeHollo wUpTriangle, shapeNone) ,5,0,CoverPrice, 0);
> PlotShapes(IIf( Short,shapeSmall DownTriangle, shapeNone) ,4,0,ShortPrice, 0);
> }
>
> Title = "{{NAME}} - {{INTERVAL}} {{DATE}} "+_DEFAULT_NAME( )+" : {{VALUES}}"+ "\n"+
> " BarsSinceBuy: "+BarsSince( Buy)+"\n" +
> " BarsSinceSell: "+BarsSince( Sell)+"\n" +
> " NextSiganl: "+(BarsSince( Buy)-BarsSince( Sell))+"\ n";
>
>
>
> --- In amibroker@xxxxxxxxx ps.com, "lucianomt" <lucianomt@> wrote:
> >
> > I tried this but only got this:
>
>
> > P = ParamField( "Price field" );
> > change = Param("% change",5,0. 1,25,0.1) ;
> > Plot( Zig(P, change), _DEFAULT_NAME( ), ParamColor( "Color", colorCycle ), ParamStyle(" Style") );
> >
> >
> >
> >
> >
> > --- In amibroker@xxxxxxxxx ps.com, "brian_z111" <brian_z111@ > wrote:
> > >
> > > It's built in....see charts >> indicators >> Zig
> > >
> > > --- In amibroker@xxxxxxxxx ps.com, "lucianomt" <lucianomt@> wrote:
> > > >
> > > > Could somebody post the code for the ZigZag indicator? Thanks!
> > > >
>
> >
> >
>