You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to get some idea on how to debug this. Just started to use backtesting.py + TA to conduct some backtesting.
Seems to work for just an EMA indicator. Tried with 'self.rsi' instead of 'self.rsi [-1]' as well. But the same ValueError was raised.
===
import pandas as pd
import yfinance as yf
import ta
from backtesting import Backtest, Strategy, set_bokeh_output
from backtesting.lib import crossover
===
Error seems to start from backtesting.py on line 139:
File ~\anaconda3\Lib\site-packages\backtesting\backtesting.py:139, in Strategy.I(self, func, name, plot, overlay, color, scatter, *args, **kwargs)
.
.
.
ValueError: attempt to get argmax of an empty sequence
The text was updated successfully, but these errors were encountered:
Hi All,
Trying to get some idea on how to debug this. Just started to use backtesting.py + TA to conduct some backtesting.
Seems to work for just an EMA indicator. Tried with 'self.rsi' instead of 'self.rsi [-1]' as well. But the same ValueError was raised.
===
import pandas as pd
import yfinance as yf
import ta
from backtesting import Backtest, Strategy, set_bokeh_output
from backtesting.lib import crossover
df = yf.download('AAPL', start='2022-12-01', end='2023-12-31')
class EMA_200(Strategy):
bt = Backtest(df, EMA_200, cash=1000000, commission=.002,
exclusive_orders=True)
stats = bt.run()
stats
===
Error seems to start from backtesting.py on line 139:
File ~\anaconda3\Lib\site-packages\backtesting\backtesting.py:139, in Strategy.I(self, func, name, plot, overlay, color, scatter, *args, **kwargs)
.
.
.
ValueError: attempt to get argmax of an empty sequence
The text was updated successfully, but these errors were encountered: