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/

    Gross Loss and Gross Win Analyzer

    General Code/Help
    2
    4
    47
    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.
    • M
      marketwizard last edited by

      Hello,

      I would like to add the Gross Win and the Gross Loss to my backtest report.
      However, I couldn't find it in the analyzers.

      How could I calculate these values ?

      Cheers,
      Marketwizard

      run-out 1 Reply Last reply Reply Quote 0
      • run-out
        run-out @marketwizard last edited by

        @marketwizard The trade analyzer provides gross wins and losses. Here's a sample output. Net would be net of commission.

        Item	Value
        total_total	2
        total_open	0
        total_closed	2
        streak_won_current	0
        streak_won_longest	0
        streak_lost_current	2
        streak_lost_longest	2
        pnl_gross_total	-3045.9996
        pnl_gross_average	-1522.9998
        pnl_net_total	-3045.9996
        pnl_net_average	-1522.9998
        won_total	0
        won_pnl_total	0
        won_pnl_average	0
        won_pnl_max	0
        lost_total	2
        lost_pnl_total	-3045.9996
        lost_pnl_average	-1522.9998
        lost_pnl_max	-1841.1436
        long_total	1
        long_pnl_total	-1204.85599999999
        long_pnl_average	-1204.85599999999
        long_pnl_won_total	0
        long_pnl_won_average	0
        long_pnl_won_max	0
        long_pnl_lost_total	-1204.85599999999
        long_pnl_lost_average	-1204.85599999999
        long_pnl_lost_max	-1204.85599999999
        long_won	0
        long_lost	1
        short_total	1
        short_pnl_total	-1841.1436
        short_pnl_average	-1841.1436
        short_pnl_won_total	0
        short_pnl_won_average	0
        short_pnl_won_max	0
        short_pnl_lost_total	-1841.1436
        short_pnl_lost_average	-1841.1436
        short_pnl_lost_max	-1841.1436
        short_won	0
        short_lost	1
        len_total	688
        len_average	344
        len_max	379
        len_min	309
        len_won_total	0
        len_won_average	0
        len_won_max	0
        len_lost_total	688
        len_lost_average	344
        len_lost_max	379
        len_lost_min	309
        len_long_total	379
        len_long_average	379
        len_long_max	379
        len_long_min	379
        len_long_won_total	0
        len_long_won_average	0
        len_long_won_max	0
        len_long_won_min	9.22337203685478E+018
        len_long_lost_total	379
        len_long_lost_average	379
        len_long_lost_max	379
        len_long_lost_min	379
        len_short_total	309
        len_short_average	309
        len_short_max	309
        len_short_min	309
        len_short_won_total	0
        len_short_won_average	0
        len_short_won_max	0
        len_short_won_min	9.22337203685478E+018
        len_short_lost_total	309
        len_short_lost_average	309
        len_short_lost_max	309
        len_short_lost_min	309
        
        M 1 Reply Last reply Reply Quote 1
        • M
          marketwizard @run-out last edited by

          @run-out I mean the total gross loss (sum of all losing trades in $) and the total gross win (sum of all winning trades in $).
          It this case it will be the "lost_pnl_total" and the "win_pnl_total" ?

          run-out 1 Reply Last reply Reply Quote 1
          • run-out
            run-out @marketwizard last edited by

            @marketwizard I believe that's correct what you say.

            1 Reply Last reply Reply Quote 2
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
            $(document).ready(function () { app.coldLoad(); }); }