-
First of all, thank you for this module that you have provided. `from backtesting import Backtest, Strategy class Super(Strategy):
df = pd.read_csv('SPY.csv', index_col=0, parse_dates=True, infer_datetime_format=True) stats = bt.run() The error I get for this is: `<class 'pandas.core.frame.DataFrame'> Column Non-Null Count Dtype0 Open 7542 non-null float64 Process finished with exit code 1 Any suggestions would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This resets all those passed series to a simple RangeIndex. Instead use e.g. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the reply and for your suggestion! ` def isLastDay(dt):
def MyIndicator(data): class MyST(Strategy):
df = pd.read_csv('..\BTbaseline\SPY.csv', index_col=0, parse_dates=True, infer_datetime_format=True) stats = bt.run() |
Beta Was this translation helpful? Give feedback.
This resets all those passed series to a simple RangeIndex. Instead use e.g.
self.data.Close.s
accessor to obtain data-indexed Series (i.e.pd.Series(self.data.Close, index=self.data.index)
).