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/

    Bug? `AttributeError: 'Cerebro' object has no attribute '_exactbars'`

    General Discussion
    2
    2
    1420
    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.
    • ?
      A Former User last edited by

      import backtrader as bt
      
      cb = bt.Cerebro()
      cb.run()
      cb.plot()
      

      Results in:

      Traceback (most recent call last):
        File "src/main.py", line 5, in <module>
          cb.plot()
        File "/home/sohail/src/trading/build/venv/lib/python3.6/site-packages/backtrader/cerebro.py", line 970, in plot
          if self._exactbars > 0:
      AttributeError: 'Cerebro' object has no attribute '_exactbars'
      
      P 1 Reply Last reply Reply Quote 0
      • P
        Paska Houso @Guest last edited by

        @Cheez said in Bug? `AttributeError: 'Cerebro' object has no attribute '_exactbars'`:

        import backtrader as bt

        cb = bt.Cerebro()
        cb.run()
        cb.plot()
        

        This was mentioned a long time ago which a quick google search has uncovered:

        https://community.backtrader.com/topic/594/cerebro-object-has-no-attribute-_exactbars-pandas-csv/3

        You need to a bit more ... like adding a data feed.

        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(); }); }