Broker and fundmode



  • 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?


  • administrators

    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



  • @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.


  • administrators

    @dasch said in Broker and fundmode:

    .broker.fundmode

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


Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.