Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
TA-lib and Simple Transform data question

Just getting into the platform and I had a question about getting accurate TA method data around the start dates of a backtest. I have found when I call TA method data such as EMA or ADX the values for the early bars are either NaN or not accurate until enough periods on the data range have passed. This doesn't seem right to me. Is there a way to retrieve an EMA(200) value that looks back the appropriate number of periods prior to the start of the backtest. Apologies if I am missing something obvious and thanks for any help anyone out there can provide.

Thanks,

Peter

1 response

Hello Peter,

It's not possible at the moment but I'm hoping the proposed 'history' feature discussed here will remedy that. Towards the end I asked what would happen if I used this in a backtest starting 2011-01-01:

data.history(bar_count=200, frequency='1d', field='price')  

and Edde replied:

Starting with the first handle_data call of the backtests, i.e. at bar 0, the history will return with the 199 preceding business days in 2010 and the first business day in 2011.

P.