I tried the following code
int barsago1 = ZigZag(Close,DeviationType.Percent,0.5,false).High Bar(0,1,100);
int barsago2 = ZigZag(Close,DeviationType.Percent,0.5,false).High Bar(0,2,100);
Print("Last Zig Zag Bar=" + barsago1 +"Bars Ago");
Print("Previous Zig Zag Bar=" + barsago2 +"Bars Ago");
Print("LastZZ High="+ High[Math.Max(0,ZigZag(DeviationType.Percent,0.5,false) .HighBar(0,1,100))]);
Print("Previous ZZ High="+ High[Math.Max(0,ZigZag(DeviationType.Percent,0.5,false) .HighBar(0,2,100))]);
Which generated the following output
12/1/2008 3:47:21 PM
Last Zig Zag Bar=-1Bars Ago
Previous Zig Zag Bar=-1Bars Ago
LastZZ High=8215
Previous ZZ High=8215
Which does not agree with the chart.....this is on the YM 12-08
Comment