Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I keep track of total realized P/L of more than 1 strategy.

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

    How do I keep track of total realized P/L of more than 1 strategy.

    Hello,

    Is it possible for me to track the real time P/L of multiple strategies with: Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit? Or does this command only track the performance of 1 strategy. In the case that this does not work, does someone know what I would use to track the total P/L for all realtime trades that I'm executing over multiple strategies.

    Thanks,
    dendy.

    #2
    dendy,

    Unfortunately cross-strategy communication of that sort is not supported. Thank you for your suggestion. We will put it on the list of future considerations.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hello Josh,

      How about pulling in the Realized PnL number from the Accounts Tab for a certain account? This numerical calculation exists inside NT and perhaps it can be used inside a strategy.

      Thanks,
      dendy.

      Comment


        #4
        dendy,

        Unfortunately not. Your suggestion is on our list of future considerations.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,
          I certainly hope this is included with NT's next minor / major release. This functionality is vitally important to many traders.

          I actually need a solution for this now. Is there nothing within the realm of possibility which may not be fully supported code?

          Thanks,
          dendy.

          Comment


            #6
            dendy,

            Unfortunately there is nothing I can prescribe at this point in time.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              This will be accessible in NT7, beta in Q1 09.
              RayNinjaTrader Customer Service

              Comment


                #8
                Ray,

                I'm very happy to hear that! Can't wait to see it.

                Thanks,
                dendy.

                Comment


                  #9
                  Ray,

                  To clarify the point. Will an actual account value such as my IB account equity be accessible inside the "OnBarUpdate" portion of a NT7 strategy? I am inferring that this will also be available along with Realized PnL for the accounts.

                  Also, as the time nears for the NT7 beta release will there be an update to the realease date?

                  Thanks,
                  dendy.

                  Comment


                    #10
                    Whatever values show up in the Control Center under the Accounts tab will be available. This is different across the supporting brokerage technologies we have. We will announce NT7 beta once we are a few weeks away.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      Ray,

                      Thanks for taking the time to respond. You answered my questions.

                      Thanks,
                      dendy.

                      Comment


                        #12
                        Dendy,

                        I accomplish cross-strategy communication using text files in the actual file system.

                        Briefly:
                        Code:
                        string dailylimitlogfile = @"c:\windows\temp\ninja\dailylimit (" + Time[0].Month + "-" + Time[0].Day + "-" + Time[0].Year + ").txt";
                                    string longpositionlogfile = @"c:\windows\temp\ninja\position_es_long (" + Time[0].Month + "-" + Time[0].Day + "-" + Time[0].Year + ").txt";
                                    string shortpositionlogfile = @"c:\windows\temp\ninja\position_es_short (" + Time[0].Month + "-" + Time[0].Day + "-" + Time[0].Year + ").txt";
                        Then read/write to it as necessary:

                        Code:
                        // create file to indicate daily limit reached
                                                
                                                TextWriter dailylimitlog = new StreamWriter(dailylimitlogfile);
                                                dailylimitlog.WriteLine(DateTime.Now + " - Daily limit reached");
                                                dailylimitlog.Close();
                        .
                        .
                        .
                        // create file to indicate in long position for es
                                                
                                                TextWriter position = new StreamWriter(longpositionlogfile);
                                                position.WriteLine(DateTime.Now + " - In long position");
                                                position.Close();
                        .
                        .
                        .
                        if (File.Exists(shortpositionlogfile)) { Print (logprefix + "In a short position it seems, doing nothing."); return; }
                                                if (File.Exists(dailylimitlogfile)) { Print (logprefix + "Daily limit reached on another strategy it seems, doing nothing."); return; }
                        I hope this helps you.

                        Comment


                          #13
                          Ctrlbrk,

                          I really appreaciate the example you provided and I'm impressed by your programming skills. Sadly, I understand some of the logic but don't know enough to change it to suit my needs. I'll continue to look at it in the coming days / weeks to see what I can do.

                          Thanks for this example!

                          dendy.

                          Comment


                            #14
                            I think if you take my basic example and then add the ReadLine function (google it) you can accomplish what you're after, tracking real-time PnL across multiple strategies.

                            My example above doesn't care about the content of the files, just whether or not they exist (it's like a true/false statement). But you can easily write a line of text in there that tracks the PnL value, then, read it back on other strategies. You could make one text file per strategy (give it a unique file name).

                            Once you read the line of text containing the value, you can manipulate it or do if statements against it like a regular variable.

                            GL.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            558 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            324 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            101 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            545 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            547 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X