See attachment "NT7 Swing CalculateOnBarClose True vs False..." which demonstrates this bug.
I have copied Swing Indicator provided by NinjaTrader to the indicator MySwing and corrected the problem.
See attachment "NT7 MySwing CalculateOnBarClose True vs False..." which demonstrates the bug fix.
Attached is the full source for MySwing that solves this problem.
Please be aware that the Indicators CandleStickPattern and CandleStickPatternAll also use the Swing Indicator and will produce incorrect results with CalculateOnBarClose set to false. These can be fixed by coping those indicators and referencing MySwing instead of Swing.
Comment