I'm working on translating some code from Metastock to Ninjatrader 8.
So MS function TroughBars(1,C,2) finds the most recent (1) Trough with 2 percent (2) deviation from Close dataseries (C).
Ninjatrader function ZigZag(Close,DeviationType.Percent,2.0,false).LowB ar(0,1,1000) does the same. (1000 - is look back period)
Should do. But actually it works different it seems, as you can see. Also it is clear that MS function is correct, but NT not.
Please, help to understand the origin of difference and how to fix it.
Thanks in advance
P.S. Functions find the number of bars since trough was find

Comment