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/

    Incorrect pnl due to multiple trades

    General Code/Help
    2
    5
    67
    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.
    • Ravi Shrimal
      Ravi Shrimal last edited by

      So my strategy is that whenever I see a signal, I will be taking a trade and also will fire a stop in the same cycle, other than that I will be exiting my trade when I see a reverse signal and will taking a new trade.
      ![0_1603277110603_image-min.jpg](Uploading 98%)
      So what is happening is that I am getting a buy signal in first row and because of that I am taking a long position at the next open and in that row I am getting a reverse signal so I am exiting my position in the 3rd row and taking a new position also because of the stop that I fired in the second row this short position get closed, but the pnl it is showing is only due to the second trade rather it should show the combined pnl for the first and second trade.
      Please help, Thanks

      1 Reply Last reply Reply Quote 0
      • Ravi Shrimal
        Ravi Shrimal last edited by

        image1-min.jpg

        Please see the screenshot.

        1 Reply Last reply Reply Quote 0
        • Ravi Shrimal
          Ravi Shrimal last edited by

          Hi backtrader, anything on this.

          1 Reply Last reply Reply Quote 0
          • A
            ab_trader last edited by

            Please post your script which produces this outputs as well as read output.

            • If my answer helped, hit reputation up arrow at lower right corner of the post.
            • Python Debugging With Pdb
            • New to python and bt - check this out
            1 Reply Last reply Reply Quote 0
            • A
              ab_trader last edited by

              Raw output, before it was transformed to the table format.

              • If my answer helped, hit reputation up arrow at lower right corner of the post.
              • Python Debugging With Pdb
              • New to python and bt - check this out
              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors