Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-strategy exit when target P/L is reached

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

    Multi-strategy exit when target P/L is reached

    I run the same strategy on several different instruments concurrently.

    Obviously each strategy has its own P/L. So is it possible and if so how would I be able to exit all positions in all strategies when a cumulative target P/L of all strategies is reached?

    Thanks

    #2
    Hello John833,

    Thank you for your note.

    This is not possible because a strategy is only aware of the instance of itself and not any other instance of any strategy. Also, there is no way to invoke Flatten Everything from within a NinjaScript.

    However, I understand that this would be a useful feature and I will submit this inquiry as a feature request to our development department. Thank you for your feedback and suggestions. We value your opinions and they will be considered in our feature discussion for a future NinjaTrader release.

    I will update you with a tracking ID for this feature request when I receive an update from our development department.

    For the time being you would need to keep an eye on your account PnL and when the desired amount is reached, click File -> Flatten Everything.
    Last edited by NinjaTrader_ChelseaB; 05-10-2013, 10:43 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea B

      Yes I am aware of File -> Flatten Everything, but I have other positions open which are not generated by the strategies. So how can I avoid these open positions from being flattened?

      Comment


        #4
        Hi John833,

        You would need to disable each strategy manually to prevent positions that are not from strategies from closing as well.

        Let me know if I can be of any other assistance.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by John833 View Post
          I run the same strategy on several different instruments concurrently.

          Obviously each strategy has its own P/L. So is it possible and if so how would I be able to exit all positions in all strategies when a cumulative target P/L of all strategies is reached?

          Thanks
          Try to save the profit of each strategy on a text file. Once the strategy closes a position then query first the last profit being saved in the text file and add it to the current profit of the position being closed. In that case you always saved the cumulative profit of all the strategy running. Don't forget to always query the last saved profit and add it to the current profit.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          637 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          571 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X