Profile Picture

Strange behavior with indicators calculated in trading system run on 16+ years of EOD data

Posted By dwalton Last Year

Strange behavior with indicators calculated in trading system run on...

Message
Crazy Posted Thursday June 02 2016
Here is my setup...
* Using Norgate integrated watchlist data store.
* Simulating a stock universe (including delisted) of the S&P 500
* Data Start Date 1/1/1999
* Trade Start Date 1/1/2000

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.

https://www.rightedgesystems.com/forums/uploads/images/59485021-1edf-4373-92c8-8954.png

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.

Dave

Posted Friday June 03 2016
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.

Thanks,
Daniel
Posted Friday June 03 2016
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.


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems