For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Error:AttributeError: module 'backtrader' has no attribute 'feeds'
-
When I create basic code, it shows "AttributeError: module 'backtrader' has no attribute 'Cerebro'
from __future__ import (absolute_import, division, print_function, unicode_literals) import backtrader as bt if __name__ == '__main__': cerebro = bt.Cerebro() cerebro.broker.setcash(100000.0) print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue()) cerebro.run() print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())
I am using 1.9.59.122 version
Windows 10Can you help me fix it ? Thank you !
-
Will be helpful to have your code posted here, otherwise it can be only stated that you did something wrong.
-
Hi,
I updated the code. Thank you :) -
You need to add data feeds.
-
I just tried to run that code in command line. That code worked but my IDE. So, I think there is problem in my IDE Pycharm.
-
Might it be that the Python interpreter (or virtualenv) used inside Pycharm is not the same as the one you use in the console?