notadamking / RLTrader

A cryptocurrency trading environment using deep reinforcement learning and OpenAI's gym
https://discord.gg/ZZ7BGWh
GNU General Public License v3.0
1.71k stars 537 forks source link

quantstrat _calc_dd cannot handle a continuously worsening dd (without recovery) epsiode #123

Open andreskull opened 4 years ago

andreskull commented 4 years ago

Traceback (most recent call last): File "./cli.py", line 52, in save_report=args.save_report) File "/home/andres/PycharmProjects/notadamking-rl-trader/lib/RLTrader.py", line 249, in train save_report=save_report) File "/home/andres/PycharmProjects/notadamking-rl-trader/lib/RLTrader.py", line 298, in test qs.reports.html(returns.Balance, file=reports_path) File "/home/andres/anaconda3/lib/python3.6/site-packages/quantstats/reports.py", line 60, in html compounded=compounded)[2:] File "/home/andres/anaconda3/lib/python3.6/site-packages/quantstats/reports.py", line 298, in metrics dd = _calc_dd(df, display=(display or "internal" in kwargs)) File "/home/andres/anaconda3/lib/python3.6/site-packages/quantstats/reports.py", line 557, in _calc_dd dd_info = _stats.drawdown_details(dd) File "/home/andres/anaconda3/lib/python3.6/site-packages/quantstats/stats.py", line 590, in drawdown_details _dfs[col] = _drawdown_details(drawdown[col]) File "/home/andres/anaconda3/lib/python3.6/site-packages/quantstats/stats.py", line 557, in _drawdown_details if starts[0] > ends[0]: IndexError: list index out of range

andreskull commented 4 years ago

https://github.com/notadamking/RLTrader/pull/124 solves the issue