Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit order and multiples entries.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Exit order and multiples entries.

    Hi,

    I have created a strategy which open positions based on two different signals (it can acumulate 2 positions at the same time).

    I am trying to close both positions using only an exit order when a specific condition is true. In order to do it I write nothing in the blank “from entry signal” of the order. However it does not work. The strategy this way closes one position on one bar and the other position on a different bar if the condition has been true.

    In order to solve that I need to create two exit orders, one for each entry signal, and I have to link each exit order to each entry signal using the “from entry signal” option.

    My question is: Is there any way of using just one exit order to close both positions at the same time?

    Thank you in advance.

    #2
    Hello Plaket,

    Thanks for opening the thread.

    If you use the overload for ExitLong() or ExitShort() that does not include a fromEntrySignal, the exit method should exit all open positions in that direction.

    In the demo below, I enter long with 2 different entries and exit my positions with a single call to ExitLong().

    Demo: https://www.screencast.com/t/i4uyntc2

    Please let me know if this information does not resolve your inquiry.

    Comment


      #3
      Thank you Jim,

      Great demostration. I really appreciate the video. Thanks.

      I am creating the strategy using Strategy Builder (Not the editor). I have created a simple strategy that reproduces the issue that I am describing.

      Attach you'll find a screenshot of the code generated (by Strategy Builder) + a screenshot of the problem on a bar chart when I try to run it.

      Perhaps, it is not possible using just an order thru Strategy Builder?

      Thank you again for your great support.
      Attached Files

      Comment


        #4
        Hello Plaket,

        Thanks for that detail.

        You are currently telling ExitLong() to exit with the DefaultQuantity, so it will only exit that number of contracts when the method is called.

        If you use "Strategy \ Current position size" for the Quantity of the exit, your strategy should exit all of the contracts in your current position. This will display as Position.Quantity once added.

        Please let me know if this does not resolve your inquiry.

        Comment


          #5
          Thank you again Jim. Everything is fixed that way.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X