Datetime index issue? #303
-
I've recently been backtesting with a few CSV files and getting this warning everytime I run the backtest: :19: UserWarning: Data index is not datetime. Assuming simple periods, but I have a time column which I have converted to DatetimeIndex and set as index but for some reason the backtesting engine adds an index column and uses that for backtesting which results in NaN values for any time-series based results like annual return. Any ideas on where I might be going wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
The code uses: backtesting.py/backtesting/backtesting.py Lines 1047 to 1057 in e3cccdf backtesting.py/backtesting/backtesting.py Lines 1079 to 1082 in e3cccdf Apparently, your index fails for: assert isinstance(df_EURUSD.index, pd.DatetimeIndex), df_EURUSD.index Can you show an example of your data frame? |
Beta Was this translation helpful? Give feedback.
The code uses:
backtesting.py/backtesting/backtesting.py
Lines 1047 to 1057 in e3cccdf
backtesting.py/backtesting/backtesting.py
Lines 1079 to 1082 in e3cccdf