Hello
When using the pd.Timestamp, backtesting is working well...
why is it throwing the error in analysing the performance??
For example:
I have fetched the data from
yfinance as follows
import yfinance as yf
start = pd.Timestamp('2020-4-1',tz ='utc')
end =pd.Timestamp('2022-4-1',tz ='utc')
bench['Index_return'] = bench['Adj Close'].pct_change(1)
bench['cum_returns'] = bench['Index_return'].cumsum()
bench.index = bench.index.tz_localize('UTC')
returns, positions, transactions = pf.utils.extract_rets_pos_txn_from_zipline(perf)
pf.create_returns_tear_sheet(returns, benchmark_rets=bench['Index_return'])
It is throwing an error as:
ERROR: KeyError: "[Timestamp('2020-07-03 00:00:00+0000', tz='UTC'), Timestamp('2020-09-07 00:00:00+0000', tz='UTC'), Timestamp('2020-11-26 00:00:00+0000', tz='UTC'), Timestamp('2021-01-01 00:00:00+0000', tz='UTC'), Timestamp('2021-01-18 00:00:00+0000', tz='UTC'), Timestamp('2021-02-15 00:00:00+0000', tz='UTC'), Timestamp('2021-05-31 00:00:00+0000', tz='UTC'), Timestamp('2021-07-05 00:00:00+0000', tz='UTC'), Timestamp('2021-09-06 00:00:00+0000', tz='UTC'), Timestamp('2021-11-25 00:00:00+0000', tz='UTC'), Timestamp('2021-12-24 00:00:00+0000', tz='UTC'), Timestamp('2022-01-17 00:00:00+0000', tz='UTC'), Timestamp('2022-02-21 00:00:00+0000', tz='UTC')] not in index"