Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Shifting Csv Data - Simple Question

Hi, Trying to figure out which way is correct/realistic when trying to shift Csv data in order to reflect a realistic 1 day delay that would occur if one were to use csv data in a live algo. My questions:

Q1 When i .shift(-1) in ide get logical record plots, meaning algo gets yesterdays csv value today, if i shift(1) then the record plot indicates that im predicting the future

Q2: However, When i shift data in research, i get logical results with .shift(1), meaning data is shifted forward 1 day, meaning i get the same plot result as when i shifted(-1) in ide

I would like a definite answer weither or not the ide shift function acts differently and if so, then how to combat that or take into account

Thanks for your time

2 responses

Oooh maybe the data you are fetching is not ordered oldest-to-newest?

Just checked, yeah, the quandl data is coming newest-to-oldest, but I think fetch_csv really wants data the other way, certainly before you shift it.

Big thanks to Simon for resolving the issue, heres how i solved it:

1 Changed data sourc to cboe instead of quandl, or if you prefer quandl then sort the date as ascending
2 Made the shift in pre_func
3 Made any and all additional calculations in post_func with the aldready shifted data