For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Backtrader bt.feeds.YahooFinanceData period='w' and 'm' not working
-
Does anyone know why
bt.feeds.YahooFinanceData(dataname='VTI', period='w', fromdate=datetime.datetime(2018,1,1), todate=datetime.datetime(2020,1,1))
does not work? It return daily data instead.
-
Try this instead of period...
timeframe=bt.TimeFrame.Weeks,
-
@run-out said in Backtrader bt.feeds.YahooFinanceData period='w' and 'm' not working:
timeframe=bt.TimeFrame.Weeks
Works perfectly. This syntax is quite different from what indicated in the docs though.
-
@thomaslee said in Backtrader bt.feeds.YahooFinanceData period='w' and 'm' not working:
Works perfectly. This syntax is quite different from what indicated in the docs though.
I could be wrong and maybe someone with more tenure can chime in, but I think yahoo stopped working for a while and the docs might be a bit out date. I dug this out of the code.