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/

    Code in Quickstart No Longer Working

    General Code/Help
    3
    3
    1105
    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.
    • John Hwang
      John Hwang last edited by

      In the quickstart, there's this bit where you initialize the datafeed for Backtrader.

      datapath = os.path.join(modpath, '../../datas/orcl-1995-2014.txt')
      
      # Create a Data Feed
      data = bt.feeds.YahooFinanceCSVData(
          dataname=datapath,
      

      This bit is broken it seems, getting FileNotFoundError. Did I forget to install something? Where do I get this 'orcl-1995-2014.txt' file?

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

        Code in Quickstart No Longer Working

        When has it stopped working? (Because you say that it is no longer working)

        @john-hwang said in Code in Quickstart No Longer Working:

        Did I forget to install something?

        You didn't tell us what you installed.

        @john-hwang said in Code in Quickstart No Longer Working:

        This bit is broken it seems, getting FileNotFoundError

        No. It's not broken. It's simply not finding the file.

        @john-hwang said in Code in Quickstart No Longer Working:

        datapath = os.path.join(modpath, '../../datas/orcl-1995-2014.txt')
        

        This is the file which is not found.

        @john-hwang said in Code in Quickstart No Longer Working:

        Where do I get this 'orcl-1995-2014.txt' file?

        You obviously copied the code from the online documentation, rather than getting the samples and the data files together from the github repository. Go there: https://github.com/backtrader/backtrader

        1 Reply Last reply Reply Quote 0
        • S
          siavash last edited by

          Hello,
          Modpath variable is the code file location.One solution is that you download and copy orcl-1995-2014.txt file to in the code file location and cleaning '../../datas/ from the code.
          have nice day

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors