I have traced this back to a bug of MAX and MIN that do not calculate correctly on Renko bars. The reason here is that MAX and MIN cannot handle bar types that support RemoveLastBar().
In fact when you calculate MAX(20) on Renko bars, it sometimes returns MAX(19) instead, not taking into account Input[19], which is omitted. This leads to logical contradictions which result in crashing indicators.
For further evidence I have attached a chart that shows an obvious miscalculation for MAX on a Renko chart. The error only occurs when MAX is applied in Calculate.OnEachTick or in Calculate.OnPriceChange. This further points to an incompatibility with RemoveLastBarSupported().
Would you be able to update MAX and MIN with the next release please? It is crashing many of my NinjaScript applications.
Comment