scrtlabs / catalyst

An Algorithmic Trading Library for Crypto-Assets in Python
http://enigma.co
Apache License 2.0
2.48k stars 724 forks source link

Is set_benchmark working properly? #86

Open vonpupp opened 6 years ago

vonpupp commented 6 years ago

Dear Catalyst Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

Now that you know a little about me, let me tell you about the issue I am having:

Description of Issue

I would like to use a simple buy and hold benchmark comparison using the set_benchmark function.

To go though and be able to se a PnL subplot of the buy and hold strategy.

I got the following error:

[2017-12-05 00:37:45.257985] INFO: run_algo: running algo in backtest mode
[2017-12-05 00:37:45.941456] INFO: exchange_algorithm: initialized trading algorithm in backtest mode
[2017-12-05 00:37:45.942983] INFO: benchmarktest: 
STARTING SIMULATION.
Candles sample rate: 60
Candles frequency: 60T
Candles buffer size: 48

Traceback (most recent call last):
  File "strategies/benchmarktest.py", line 275, in <module>
    live_graph=False
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/utils/run_algo.py", line 594, in run_algorithm
    live_graph=live_graph
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/utils/run_algo.py", line 389, in _run
    overwrite_sim_params=False,
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/exchange/exchange_algorithm.py", line 280, in run
    data, overwrite_sim_params
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/algorithm.py", line 725, in run
    for perf in self.get_generator():
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/algorithm.py", line 623, in get_generator
    return self._create_generator(self.sim_params)
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/algorithm.py", line 602, in _create_generator
    self._create_benchmark_source(),
  File "/home/av/repos/test/.envc-unstable/lib/python2.7/site-packages/catalyst/algorithm.py", line 560, in _create_benchmark_source
    benchmark_asset = self.asset_finder.retrieve_asset(
AttributeError: 'AssetFinderExchange' object has no attribute 'retrieve_asset'

Here is how you can reproduce this issue on your machine:

Reproduction Steps

  1. Create a default skeleton
  2. Add set_benchmark(symbol(<coin pair>))

What steps have you taken to resolve this already?

None, no clue.

Sincerely, Vonpupp.

fredfortier commented 6 years ago

Currently, the benchmark only. I understand what you are trying to do. We can address this before the next release.

jspillers commented 6 years ago

Just wanted to share that I also ran into this exact same issue on Mac OS X

vonpupp commented 6 years ago

Thank you @fredfortier.