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/

    Broker and fundmode

    General Code/Help
    2
    4
    1883
    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.
    • D
      dasch last edited by

      with the latest version when using oanda broker, it breaks with follwing code:

      File "/usr/local/lib/python2.7/dist-packages/backtrader/observers/broker.py", line 100, in start
      self._fundmode = self._owner.broker.fundmode
      AttributeError: 'OandaBroker' object has no attribute 'fundmode'

      does anyone know, how to fix this?

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

        The latest (would be good to quote the actual version) keeps on adding auto-detection of fundmode for things to switch the presentation/results.

        That particular observer was touched and the error shows that a couple of corners in adding some abstraction for fundmode could be there.

        Since you are using Oanda let's assume you don't want to plot. Run with:

        cerebro.run(stdstats=False)
        

        If you are using Oanda for some backtesting (rather than live trading) and need plotting, you can re-add observers as needed (or else revert to 1.9.55.122)

        It will be fixed in the development branch

        D 1 Reply Last reply Reply Quote 0
        • D
          dasch @backtrader last edited by dasch

          @backtrader i tried 1.9.57.122 and 1.9.56.122, reverting to a version prior to the funds functionality works.

          Also using stdstats=False works.

          Thanks a lot for your help and this great software.

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

            @dasch said in Broker and fundmode:

            .broker.fundmode

            Corrected in the development branch by having default no-op methods in the broker abstraction

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors