Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Open P&L from different systems

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

    Open P&L from different systems

    Hi,

    I'm creating a strategy where I use two different systems on different accounts.
    Let's say I want to close both my positions if the total sum of open positions p&l is $100.

    Is there a way to reference the single open position p&l and use them as a variable?

    Example:

    System A - Open P&L $20
    System B - Open P&L $80

    Total Open P&L = $100

    Close my positions on both systems.

    Thanks for any help

    #2
    Max,

    Unfortunately there isn't currently any supported way to do this currently. Please let me know if I may answer any other questions.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I'm thinking about using an external txt file to collect informations. Could, in your opinion, this be a useful solution?

      Thanks.

      Comment


        #4
        Max,

        You could do this, but you may run into file access issues. The main issue here is that if a file is open in 1 strategy, then the other strategy tries to open it, it may cause an exception. I would suggest opening and closing the file between writes to help eliminate this.

        You can handle exceptions using try-catch blocks, then have the strategy wait until the file is free. This allows you to handle any file access exceptions gracefully rather than having your strategy crash.

        Adam P.NinjaTrader Customer Service

        Comment


          #5
          What if I use a main strategy to control both strategies. The main one could open 2 txt files at the same time and check for the values?

          Thanks.

          Comment


            #6
            MAX,

            Currently there is no supported way to have one strategy control another two. However, it is possible to create a multi-instrument strategy.

            If you were to combine your 2 strategies into one it would work. The strategy can trade to two different instruments.
            Adam P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            666 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            377 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X