I'm seeing very strange behavior from indicators calculated in my trading system. Basically it looks like the calculation is shifted (look ahead) by over a year -- last indicator value is 5/17/2015 whereas last bar data is 5/31/2016. I've attached a chart illustrating this. I use the built-in simple moving average indicator with a 200 bar period (light blue line named _symbolSMA in the trading system). If I open a chart from the trading system results and then manually add another 200-bar simple moving average (Purple line in the chart), it is calculated correctly.

Some additional data... If I start the simulation later (shift data and trade start days a year later or more), the indicators get calculated correctly.

I can provide code if that helps debug it. Please advise if there is a known issue that would explain this.

Can you add some logging to your system for the value of the SMA, and see whether those values are correct or whether they match what's shown on the chart? It's possible the indicator is being calculated correctly but is being displaced when it is being displayed on the chart.

Daniel, I added logging and the indicator is indeed calculated correctly and just wrong on the chart. I found this by using the chart and associated indicators to check my entry/exit signals. Obviously if the chart is wrong the signals don't make sense.