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

How to not plot Broker and Trades?



  • I am aware of the stdstats=False option but that removes a whole bunch of functionality. What I am interested in is just removing the Broker and Trades subplots on matplotlib output. In other words how to set

    plotinfo = dict(plot=True, subplot=True)
    

    To

    plotinfo = dict(plot=False)
    

    Where/how exactly is that achieved?


  • administrators

    The only way is to use stdstats=False and then add your custom set of Observers.

    stdstats is meant as a default set of reasonable observers to use. Any other combination is a user defined one.



  • @backtrader Thx for the clarification! Had literally just started writing a subclass of Observer

    class OurBroker(Broker):
        plotinfo = dict(plot=False, subplot=True)
    

    Very complicated :)


  • administrators

    Nothing would prevent you from directly monkey-patching the existing observer classes or replace them in the modules with your own subclasses, but imho, it is better to use addobserver.