when using SUM on a custom Series<double>, an Exception occurs on State change to realtime. (After successfully calculating hundreds of historical bars).
"Exception has been thrown by the target of an invocation".
Calculate was set to Calculate.OnBarClose but changing it made no difference.
Example code (an MFI calculation):
Value[0] = (SUM(negative, Period)[0] == 0 ? 50 : 100.0 - (100.0 / (1 + SUM(positive, Period)[0] / SUM(negative, Period)[0]))); // causes exception in transition to Realtime
Cheers,
saltminer
Comment