For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Quick Start Data Referenced but Not sourced?
-
I've been trying to follow along in my own local enviornement with the quickstart guide.
One thing that's tripping me up is in the section on adding a data feed.
In the code we have something like:
def example_3(): """adding a data feed""" cerebro = bt.Cerebro() modpath = os.path.dirname(os.path.abspath(sys.argv[0])) datapath = os.path.join(modpath, 'datas', 'orcl-1995-2014.txt') data = bt.feeds.YahooFinanceCSVData( dataname=datapath, fromdate=datetime.datetime(2000, 1, 1), todate=datetime.datetime(2000, 12, 31), reverse=False ) cerebro.adddata(data) cerebro.broker.setcash(100000.0) print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue()) cerebro.run() print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())
Where is this
orc1-1995-2014.txt
coming from? Is it expecting us to download some data from Yahoo Finance or something?
-
The datas are located here: https://github.com/mementum/backtrader/tree/master/datas
-
@leggomaeggo Ah, thank you. That's a big help. Not sure where I missed that mentioned in the documentation.