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

drawdown per trade in def notify_trade():



  • is there a way to get drawdown per trade already written up? I know you can get drawdown in the observer but thats more for plotting. I know you can get drawdown in the analyzer as well but that seems to just be the max drawdown. Thanks


  • administrators

    @blonc said in drawdown per trade in def notify_trade()::

    I know you can get drawdown in the analyzer as wellbut that seems to just be the max drawdown

    Wrong knowledge then. Docs - Analyzers

    Quoting from the DrawDown docs:

        Methods:
    
          - ``get_analysis``
    
            Returns a dictionary (with . notation support and subdctionaries) with
            drawdown stats as values, the following keys/attributes are available:
    
            - ``drawdown`` - drawdown value in 0.xx %
            - ``moneydown`` - drawdown value in monetary units
            - ``len`` - drawdown length
    
            - ``max.drawdown`` - max drawdown value in 0.xx %
            - ``max.moneydown`` - max drawdown value in monetary units
            - ``max.len`` - max drawdown length
    

Log in to reply
 

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