Fixed - Error running example buy_btc_ simple.py: RuntimeWarning: Degrees of freedom <= 0 for slice


#1

(catalyst) C:\Users\Ernst>catalyst run -f g:\Catalyst\PyCharm\project05\buy_btc_
simple.py -x binance --start 2016-1-1 --end 2017-9-30 -c usd --capital-base 1000
00 -o buy_btc_simple_out.pickle
Running in backtesting mode.
[2018-07-17 20:16:30.463678] WARNING: run_algo: Catalyst is currently in ALPHA.
It is going through rapid development and it is subject to errors. Please use ca
refully. We encourage you to report any issue on GitHub: https://github.com/enig
mampc/catalyst/issues
[2018-07-17 20:16:30.463678] INFO: run_algo: Catalyst version 0.5.15
[2018-07-17 20:16:33.465434] INFO: run_algo: running algo in backtest mode
[2018-07-17 20:16:34.192713] INFO: exchange_algorithm: initialized trading algor
ithm in backtest mode
Traceback (most recent call last):
File “c:\users\ernst\anaconda3\envs\catalyst\lib\runpy.py”, line 193, in run
module_as_main
main”, mod_spec)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\runpy.py”, line 85, in run_c
ode
exec(code, run_globals)
File "C:\Users\Ernst\Anaconda3\envs\catalyst\Scripts\catalyst.exe_main
.py"
, line 9, in
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\core.py”,
line 722, in call
return self.main(*args, **kwargs)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\core.py”,
line 697, in main
rv = self.invoke(ctx)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\core.py”,
line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\core.py”,
line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\core.py”,
line 535, in invoke
return callback(*args, **kwargs)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst__main
__.py”, line 105, in _
return f(*args, **kwargs)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\click\decorator
s.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst__main
__.py”, line 292, in run
stats_output=None,
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\utils
run_algo.py”, line 363, in _run
overwrite_sim_params=False,
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\exchan
ge\exchange_algorithm.py”, line 402, in run
data, overwrite_sim_params
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\exchan
ge\exchange_algorithm.py”, line 359, in run
data, overwrite_sim_params
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\algori
thm.py”, line 725, in run
for perf in self.get_generator():
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\gens\t
radesimulation.py”, line 235, in transform
yield self._get_daily_message(dt, algo, algo.perf_tracker)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\gens\t
radesimulation.py”, line 291, in _get_daily_message
dt, self.data_portal,
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\financ
e\performance\tracker.py”, line 393, in handle_market_close
account.leverage)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\financ
e\risk\cumulative.py”, line 277, in update
self.algorithm_returns,
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\catalyst\patche
s\stats.py”, line 563, in sharpe_ratio
if np.std(returns_risk_adj, ddof=1) == 0:
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\numpy\core\from
numeric.py”, line 3075, in std
**kwargs)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\numpy\core_met
hods.py”, line 135, in _std
keepdims=keepdims)
File “c:\users\ernst\anaconda3\envs\catalyst\lib\site-packages\numpy\core_met
hods.py”, line 93, in _var
stacklevel=2)
RuntimeWarning: Degrees of freedom <= 0 for slice


#2

Hi @Ernestopheles,

Please use catalyst coverage page to learn about the supported trading pairs and their supported intervals per each exchange.
In regards to this specific issue:

  1. Binance support usdt and not usd so please specify the correct quote currency in the command line.
  2. The btc_usdt pair is supported from 2017-08-18 so please update the algorithm start date accordingly.

Lena


#3

Hi Lena,

thanks for helping. I am sorry for having been so thoughtless.

Ernst