I am trying to calculate the volatility (standard deviation, ATR) for futures contracts. However I ran into a snag for JY & JE in 2012. The problem is: the results from data.history in a backtest show every day having the same value for a stretch of time, this occurs for over 100 days in the summer of 2012. The actual price did not look like this. It appears that the date is getting truncated to 3 significant digits. What is interesting is that this only happens for days earlier than t-1.
Here is an example where on 2012-09-24 I fetch the last 100 days data for the continuous future JY. (See the attached backtest)
2012-09-24 06:31 PRINT close high low price
2012-09-18 00:00:00+00:00 0.012000 0.012000 0.012000 0.012000
2012-09-19 00:00:00+00:00 0.012000 0.012000 0.012000 0.012000
2012-09-20 00:00:00+00:00 0.012000 0.012000 0.012000 0.012000
2012-09-21 00:00:00+00:00 0.012000 0.012000 0.012000 0.012000
2012-09-24 00:00:00+00:00 0.012827 0.012835 0.012803 0.012827
2012-09-24 06:31 PRINT ATRs: {'JE': 0.0, 'JY': 0.0}
2012-09-24 06:31 PRINT SDs: {'JE': 8.716877585302702e-18, 'JY': 8.716877585302702e-18}
I take the data from the last 100 days and calculate the ATR and Standard deviation, for many weeks these values are effectively 0.
I remember reading on one post on futures that the values were only displayed to three significant digits, but this was only a display issue. That doesn't seem to be the case as any math on t-1 values shows that there are only three significant digits in there.
Does anyone know why these values are incorrect? If you plot the values of JY in Research you do not get this.
Thanks for the help.