kieran-mackle / AutoTrader

A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
https://kieran-mackle.github.io/AutoTrader/
GNU General Public License v3.0
945 stars 217 forks source link

IndexError: index 0 is out of bounds for axis 0 with size 0 #23

Closed vnvdev closed 2 years ago

vnvdev commented 2 years ago

Traceback (most recent call last): File "C:\Users\Tomk Vu\Desktop\autotrader-demo-main\runfile.py", line 19, in at.run() File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\autotrader\autotrader.py", line 226, in run self._run_optimise() File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\autotrader\autotrader.py", line 1266, in _run_optimise result = brute(func = self._optimisation_helper_function, File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\optimize_optimize.py", line 3496, in brute
Jout = np.array(list(mapper(wrapped_func, grid))) File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\optimize_optimize.py", line 3568, in call return self.f(np.asarray(x).flatten(), *self.args) File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\autotrader\autotrader.py", line 1336, in _optimisation_helper_function backtest_results = self.analyse_backtest(bot) File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\autotrader\autotrader.py", line 861, in analyse_backtest backtest_results['start'] = account_history.index[0] File "C:\Users\Tomk Vu\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\base.py", line 5039, in getitem return getitem(key) IndexError: index 0 is out of bounds for axis 0 with size 0