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/

    backtrader connection errors

    General Discussion
    2
    2
    75
    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.
    • J
      JohnAddae last edited by

      am getting the error''ModuleNotFoundError: No module named 'backtrader'
      anytime i run any code in the ide

      from future import (absolute_import, division, print_function,
      unicode_literals)

      import backtrader as bt

      if name == 'main':
      cerebro = bt.Cerebro()

      print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue())
      
      cerebro.run()
      
      print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())
      

      ModuleNotFoundError Traceback (most recent call last)
      <ipython-input-1-bd9375d3f4ab> in <module>
      2 unicode_literals)
      3
      ----> 4 import backtrader as bt
      5
      6 if name == 'main':

      ModuleNotFoundError: No module named 'backtrader'

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        First guess would be that the script you try to run has backtrader.py name. Rename it. If it doesn't fix the error, than you have some issue swith the installation. Feel free to google how to fix ModuleNotFoundError: error. Correctly installed and used bt doesn't return this error.

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }