Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Error with Test Script on Home Page

    General Discussion
    4
    5
    1661
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Benjamin Preston Lee Turner
      Benjamin Preston Lee Turner last edited by

      Hello,

      I tried to run the test script on the first page of the backtrader website and received errors. I received the same error on two different machines.

      Can someone help me out?

      Traceback (most recent call last):
      File "test1.py", line 17, in <module>
      cerebro.run()
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\cerebro.py", line 1127, in run
      runstrat = self.runstrategies(iterstrat)
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\cerebro.py", line 1207, in runstrategies
      data._start()
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\feed.py", line 203, in _start
      self.start()
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\feeds\yahoo.py", line 459, in start
      super(YahooFinanceData, self).start()
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\feeds\yahoo.py", line 90, in start
      super(YahooFinanceCSVData, self).start()
      File "C:\Users\dx\AppData\Local\Programs\Python\Python35-32\lib\site-packages
      backtrader\feed.py", line 671, in start
      self.f = io.open(self.p.dataname, 'r')
      FileNotFoundError: [Errno 2] No such file or directory: 'YHOO'

      1 Reply Last reply Reply Quote 0
      • P
        Paska Houso last edited by

        Yahoo is probably down. There is a thread in the community that explained that in the absence of network connection, the feed would try to fetch a cached version of the data feed using the same name in the local directory (which you obviously don't have)

        In any case the Yahoo API is gone for good (given the glitches that Yahoo introduces in the new downloads, including random reversal of columns close/adjusted close)

        Your best bet is to use some other data feed, for example QUANDL

        Note: See the top of the forum for properly posting those error traces (else, they are mostly unreadable)

        1 Reply Last reply Reply Quote 1
        • P
          Paska Houso last edited by

          A bit of Googling some hours later has uncovered the aforementioned thread with the local file feature:

          • https://community.backtrader.com/topic/522/yahoofinancedata-filenotfounderror/
          1 Reply Last reply Reply Quote 0
          • nikolayhg
            nikolayhg last edited by

            I get the same error. Would be very useful to have a working example on the README.rst!

            1 Reply Last reply Reply Quote 0
            • B
              backtrader administrators last edited by

              Do you have any free and working online data source?

              The README.rst clearly states:

              Yahoo API Note:
              
              Don't use it. Yahoo removed the original API and the alternative methods are prone to failure due to the glitches introduced by Yahoo (column swapping and others)
              

              Blame Yahoo!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
              $(document).ready(function () { app.coldLoad(); }); }