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

Incorrect pnl due to multiple trades

  • 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

  • image1-min.jpg

    Please see the screenshot.

  • Hi backtrader, anything on this.

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

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

Log in to reply