backtrader2/backtrader

FileNotFoundError: [Errno 2] No such file or directory: "'^GDAXI'"

Opened this issue · 3 comments

I used this example but unfortunately got errors. The full traceback is:

  File "/projects/quant_exp/stategies/weekdaysaligner.py", line 109, in <module>
    runstrat()
  File "/projects/quant_exp/stategies/weekdaysaligner.py", line 64, in runstrat
    cerebro.run(runonce=True, preload=True)
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/cerebro.py", line 1127, in run
    runstrat = self.runstrategies(iterstrat)
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/cerebro.py", line 1210, in runstrategies
    data._start()
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/feed.py", line 203, in _start
    self.start()
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/feeds/yahoo.py", line 361, in start
    super(YahooFinanceData, self).start()
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/feeds/yahoo.py", line 94, in start
    super(YahooFinanceCSVData, self).start()
  File "/anaconda3/envs/cc/lib/python3.7/site-packages/backtrader/feed.py", line 674, in start
    self.f = io.open(self.p.dataname, 'r')
FileNotFoundError: [Errno 2] No such file or directory: "'^GDAXI'"

Having the same issue. It seems the yahoo API has changed again. Backtrader cannot find "CrumbStore" in the reply (yahoo.py:278):

i = txt.find('CrumbStore')

Apparently, the crumb cookie is no longer needed by the yahoo API. So the first phase of obtaining the cookie can be discarded and the whole fetching simplified in yahoo.py.

Apparently, the crumb cookie is no longer needed by the yahoo API. So the first phase of obtaining the cookie can be discarded and the whole fetching simplified in yahoo.py.

Works for me just delete all the crumb related code in yahoo.py. Deleting code is always satisfying.