Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
What did you expect to happen?
Catalyst to exit without error after paper-trading period ended.
What happened instead?
I get a RuntimeWarning:
File "algo.py", line 191, in <module>
quote_currency="usd"
File "/home/user/.venv/lib64/python3.6/site-packages/berserkerlib/execute.py", line 140, in parse_params_and_execute
logger=logger,
File "/home/user/.venv/lib64/python3.6/site-packages/berserkerlib/execute.py", line 218, in execute_algorithm
live=live,
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/utils/run_algo.py", line 596, in run_algorithm
stats_output=stats_output
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/utils/run_algo.py", line 358, in _run
overwrite_sim_params=False,
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 1051, in run
data, overwrite_sim_params
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/exchange/exchange_algorithm.py", line 359, in run
data, overwrite_sim_params
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/algorithm.py", line 725, in run
for perf in self.get_generator():
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/gens/tradesimulation.py", line 247, in transform
risk_message = algo.perf_tracker.handle_simulation_end()
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/finance/performance/tracker.py", line 470, in handle_simulation_end
treasury_curves=self.treasury_curves,
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/finance/risk/report.py", line 98, in __init__
1, start_session, end_session
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/finance/risk/report.py", line 157, in periods_in_range
algorithm_leverages=self.algorithm_leverages,
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/finance/risk/period.py", line 81, in __init__
self.calculate_metrics()
File "/home/user/.venv/lib64/python3.6/site-packages/catalyst/finance/risk/period.py", line 126, in calculate_metrics
self.algorithm_returns,
File "/home/user/.venv/lib64/python3.6/site-packages/empyrical/stats.py", line 561, in sharpe_ratio
if np.std(returns_risk_adj, ddof=1) == 0:
File "/home/user/.venv/lib64/python3.6/site-packages/numpy/core/fromnumeric.py", line 3038, in std
**kwargs)
File "/home/user/.venv/lib64/python3.6/site-packages/numpy/core/_methods.py", line 140, in _std
keepdims=keepdims)
File "/home/user/.venv/lib64/python3.6/site-packages/numpy/core/_methods.py", line 98, in _var
stacklevel=2)
RuntimeWarning: Degrees of freedom <= 0 for slice
Here is how you can reproduce this issue on your machine:
Reproduction Steps
I dont know how to reproduce it. I got it randomly (maybe once a month). This time it was at paper-trading. I think, it is maybe a problem with empyrical.
What steps have you taken to resolve this already?
I tried upgrading empyrical, but it breaks a lot of other things.
I guess it's the data you pulled has some days missing. I copied the default hodl script and change the exchange to binance then it gave me this error too.
Dear Catalyst Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Linux backtest 3.10.0-862.11.6.el7.x86_64 #1 SMP Tue Aug 14 21:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Python 3.6.5
64
pip
aiodns==1.1.1 aiohttp==3.0.1 alembic==0.9.7 async-timeout==2.0.1 attrdict==2.0.0 attrs==18.1.0 bcolz==1.2.1 berserkerlib==0.0.7 boto3==1.5.27 botocore==1.8.50 Bottleneck==1.2.1 cchardet==2.1.1 ccxt==1.12.131 certifi==2018.1.18 chardet==3.0.4 click==6.7 contextlib2==0.5.5 cycler==0.10.0 cyordereddict==1.0.0 Cython==0.27.3 cytoolz==0.9.0.1 decorator==4.3.0 docutils==0.14 empyrical==0.2.1 enigma-catalyst==0.5.18 eth-abi==1.1.1 eth-account==0.2.3 eth-hash==0.1.4 eth-keyfile==0.5.1 eth-keys==0.2.0b3 eth-rlp==0.1.2 eth-typing==1.1.0 eth-utils==1.2.0 hexbytes==0.1.0 idna==2.6 idna-ssl==1.1.0 intervaltree==2.1.0 jmespath==0.9.3 kiwisolver==1.0.1 Logbook==0.12.5 lru-dict==1.1.6 lxml==4.2.4 Mako==1.0.7 MarkupSafe==1.0 matplotlib==2.2.3 multidict==4.3.1 multipledispatch==0.4.9 networkx==2.1 numexpr==2.6.4 numpy==1.15.1 pandas==0.19.2 pandas-datareader==0.6.0 parsimonious==0.8.0 patsy==0.5.0 pycares==2.3.0 pycryptodome==3.6.6 pyparsing==2.2.0 python-dateutil==2.7.3 python-editor==1.0.3 pytz==2018.5 redo==1.6 requests==2.18.4 requests-file==1.4.3 requests-ftp==0.3.1 requests-toolbelt==0.8.0 rlp==1.0.2 s3transfer==0.1.13 scipy==1.0.0 six==1.11.0 sortedcontainers==1.5.9 SQLAlchemy==1.2.2 statsmodels==0.8.0 tables==3.4.2 toolz==0.9.0 urllib3==1.22 web3==4.2.1 websockets==6.0 wrapt==1.10.11 yarl==1.1.0
Now that you know a little about me, let me tell you about the issue I am having:
Description of Issue
What did you expect to happen? Catalyst to exit without error after paper-trading period ended.
What happened instead? I get a RuntimeWarning:
Here is how you can reproduce this issue on your machine:
Reproduction Steps
I dont know how to reproduce it. I got it randomly (maybe once a month). This time it was at paper-trading. I think, it is maybe a problem with empyrical.
What steps have you taken to resolve this already?
I tried upgrading empyrical, but it breaks a lot of other things.
Anything else?
No
Sincerely, Simon Brand