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/

    Where find and put the data ?

    General Code/Help
    1
    1
    301
    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.
    • S
      Simone last edited by Simone

      Hi, at all, i'm new with backtrader and following the quickstart of the official page i've copied and paste some line of codes to try to understand how backtrader works. I'm not a programmer but i want to improve myself and learn. my problem i think for that i've understand is that it doesn't find the data. But i don't understand where i've to put the data. I've searched on internet and i've found another guy that has been the same problem (https://community.backtrader.com/topic/951/cannot-find-file-orcl-1995-2014-txt-from-the-quickstart-tutorial/4) but i didn't understand. I'll put below the output. Can somebody help me?

      Starting Portfolio Value: 100000.00


      FileNotFoundError Traceback (most recent call last)
      <ipython-input-3-b8cdb1f6eed7> in <module>
      37
      38 # Run over everything
      ---> 39 cerebro.run()
      40
      41 # Print out the final result

      ~/anaconda3/lib/python3.7/site-packages/backtrader/cerebro.py in run(self, **kwargs)
      1125 # let's skip process "spawning"
      1126 for iterstrat in iterstrats:
      -> 1127 runstrat = self.runstrategies(iterstrat)
      1128 self.runstrats.append(runstrat)
      1129 if self._dooptimize:

      ~/anaconda3/lib/python3.7/site-packages/backtrader/cerebro.py in runstrategies(self, iterstrat, predata)
      1208 if self._exactbars < 1: # datas can be full length
      1209 data.extend(size=self.params.lookahead)
      -> 1210 data._start()
      1211 if self._dopreload:
      1212 data.preload()

      ~/anaconda3/lib/python3.7/site-packages/backtrader/feed.py in _start(self)
      201
      202 def _start(self):
      --> 203 self.start()
      204
      205 if not self._started:

      ~/anaconda3/lib/python3.7/site-packages/backtrader/feeds/yahoo.py in start(self)
      92
      93 def start(self):
      ---> 94 super(YahooFinanceCSVData, self).start()
      95
      96 if not self.params.reverse:

      ~/anaconda3/lib/python3.7/site-packages/backtrader/feed.py in start(self)
      672 else:
      673 # Let an exception propagate to let the caller know
      --> 674 self.f = io.open(self.p.dataname, 'r')
      675
      676 if self.p.headers:

      FileNotFoundError: [Errno 2] No such file or directory: '/home/simone/anaconda3/lib/python3.7/site-packages/../../datas/orcl-1995-2014.txt'

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