For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Where find and put the data ?

  • 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 ( 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>
    38 # Run over everything
    ---> 39
    41 # Print out the final result

    ~/anaconda3/lib/python3.7/site-packages/backtrader/ 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/ 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/ in _start(self)
    202 def _start(self):
    --> 203 self.start()
    205 if not self._started:

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

    ~/anaconda3/lib/python3.7/site-packages/backtrader/ in start(self)
    672 else:
    673 # Let an exception propagate to let the caller know
    --> 674 self.f =, 'r')
    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'

Log in to reply