The Cyan line is an expected mean value, with which I am calculating standard deviation bands from, and at some point in the data the std deviation calculation "blows up". Now they aren't going to NAN or near double.epsilon, but they become incredibly large. Now when I had this indicator running as a simple lookback version in OBU, I never had any issues with this.
Code wise it looks like this. Now this is trimmed down code. Is there some catch that I am missing?
predictedMeanSD = StdDev(predictionOutput, 25);
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{[INDENT]double prediction = Filter.getPrediction()[0];[/INDENT][INDENT]if (double.IsNaN(prediction) == true)
{[/INDENT][INDENT=2]//Print("Test");
predictionOutput[0] = lastOutput;[/INDENT][INDENT]}
else
{[/INDENT][INDENT=2]// cyan predictedMean
Values[0][0] = prediction;
// secondary series that is the input to the stdDev();
predictionOutput[0] = prediction;
double meanSD = predictedMeanSD[0];
Values[1][0] = prediction + meanSD;
Values[2][0] = prediction - meanSD;[/INDENT][INDENT]}[/INDENT]
}

Comment