I think I might have found a bug in Quantopian's history function. If the problem is me misunderstanding something then please forgive me.
From the help docs on history:
data.history(context.assets, "price", 1, "1d") returns the current price.
data.history(context.assets, "price", 1, "1m") returns the current price.
And so you would expect these two calls to return the same value. But they don't always do so. Quite often there is a very small difference, which is fine. Sometimes the difference is quite large. The attached backtest logs the differences so you can see them.
So what is happening? Is it something I don't understand? Is this a 'feature'?
Please explain the current behavior as I have an algo that is performing very well, but I need to understand this in order to understand precisely why it is performing so well in some configurations. It is almost too good to be true, so watch out for bugs that allow data snooping with the history function related to this behavior.