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/

    HELP A NOOB TO START!

    General Code/Help
    2
    2
    975
    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.
    • Antonio Hoffert
      Antonio Hoffert last edited by

      I am using Pycharm withy a Python 3.6 interpreter and getting this import error upon building:

      import datetime
      import backtrader as bt
      import backtrader.feeds as btfeed

      data = btfeed.GenericCSVData(
      dataname='coinbase.csv',

      fromdate=datetime.datetime(2000, 1, 1),
      todate=datetime.datetime(2000, 12, 31),
      
      nullvalue=0.0,
      
      dtformat=('%Y-%m-%d'),
      
      datetime=0,
      high=1,
      low=2,
      open=3,
      close=4,
      volume=5,
      openinterest=-1
      

      )


      Traceback (most recent call last):
      File "/Users/hoffert/Desktop/Python/Backtest/backtrader.py", line 2, in <module>
      import backtrader as bt
      File "/Users/hoffert/Desktop/Python/Backtest/backtrader.py", line 3, in <module>
      import backtrader.feeds as btfeed
      ImportError: No module named feeds

      Process finished with exit code 1

      What should I do? Many thanks.

      1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        The best way to let the NOOB tag behind onself is to 1st read what one has before the eyes, specifically at the top of each and every page of the community.

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

        Formatting is key to let others see more clearly what's happening and therefore be able to interact with you.

        As for your error, this is a common rookie mistake (every Python programmer has for sure made it)

        • Don't name your script with the same name as the library you want to work with. Because your script doesn't contain any module named feeds
        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(); }); }