Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade Performance Calculations Are Wrong

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

    Trade Performance Calculations Are Wrong

    For quite some time, I have suspected that the trade performance window was not accurate in showing P&L on multiple occasions. I recently found a direct comparison to illustrate how there's likely something wrong in how the code is written to calculate P&L. Correct me if I'm wrong. That could be possible here. The screenshots below show how if the time frame is from 1/14/24 to 1/17/24 the net P&L is $4,100. If I remove Sunday 1/14 and run the test from 1/15 to 1/17 there are no additional trades but the profit increases by >450%. Adding a day shouldn't change the profits of other days. I'm curious if this is a user error but I'm doubtful.

    One complaint I have and which might be a contributing factor to why the platform isn't calculating things properly is how P&L in the trade performance window seems to be broken down by 24 hour windows meaning that your P&L on a "Tuesday" will not include the trades taken during the same session that started Monday night, why is that? Furthermore, it then adds the P&L of WEDNESDAY'S session that occurs before midnight to "Tuesday's" session? I would find that MOST traders prefer to break down their daily performance by SESSIONS vs a day's 24 hr window.

    I could begrudgingly understand why the Trade Performance window does things by a 24 hr cycle. Even though my opinion is that P&L should be split up into sessions, I could understand why things are done how they are if it weren't for the fact that P&L it is NOT calculated that same way under the accounts tab. P&L is calculated based on each session. Why is it that in your accounts tab, the P&L is displayed in a logical and correct way but then in the Trade Performance window, it is not? What makes it worse is that the user can't even choose to then break down their trade stats by a per session basis.
    Attached Files

    #2
    Hello Ymcaptial,

    Thank you for your note.

    I'd like to preface this conversation with the fact that the Trade Performance report has no bearing on actual trades that occurred and should always be considered secondary to your brokerage statement. NinjaTrader has no concept of 'trades', but simply pairs together executions. There are many reasons why a Trade Performance report can become out of sync. A few examples of this:
    • Partial fills
    • Missing executions
    • Holding overnight positions
    • Running a report from a start date on which you were not flat
    • Using another program to place an order will not show this order in NinjaTrader, including another instance of NinjaTrader on another computer.
    ​You will need to ensure you use a start date where you started the day flat so the report is accurate.

    The first execution of the day is used as the first Entry for the day even if it was an exit order for a position from the previous day. This will cause the executions to become mismatched and show erroneous results.

    Spencer F.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Spencer. My proclivity is to trust the system and think that your explanations could be why there are discrepancies but unfortunately I've noticed this type of issue for quite some time and find it hard to conclude this is why the P&Ls change. The examples you gave are not likely to be applicable to this or the other scenarios I've experienced because none of these trades held through the close. No other platform or computer is being used to place trades on these accounts.

      If the Accounts tab can accurately track P&L, why is that not the case in the Trade Performance window?

      Comment


        #4
        Hello Ymcapital,

        Thank you for your post.

        The values in the Account Tab are provided directly from your account connection (i.e.Broker) where as the Trade Performance is built from the recorded executions on the database file.

        Spencer F.NinjaTrader Customer Service

        Comment


          #5
          That's great to know. Looping back around though, that doesn't preclude any of the facts I've provided earlier. None of these trades in this example were held through the close. No other platform or computer is being used to place trades on these accounts.

          Comment


            #6
            Hello Ymcaptial,

            Thank you for your post.

            It would not be the market close but holding position from one calendar day to the other. If you start a position at 11:59 on 11/17 for example and then close it at 12:01 on 11/18 and the report start date is 11/18 the report will be desynched as the first execution of the day is an exit order.
            Spencer F.NinjaTrader Customer Service

            Comment


              #7
              That's interesting which brings me back to the original point I was making, why not make the Trade Performance "days" actually split by the session and not a 24 hour clock? I'm aware that different instruments have different start times but as far as I'm aware and correct me if I'm wrong, futures sessions start the Monday session on Sunday and all end on Friday. If the holding of position from one calendar day to the other is the issues that causes these vast fluctuations in the display of PNL, why isn't it broken up into sessions the same way the PNL is in the Accounts and Strategy tabs when that information is displayed?

              Comment


                #8
                Still no response to this? NinjaTrader_Spencer

                Comment


                  #9
                  Here's another example of how this makes no sense. In your first message, you said that the change in PnL could be due to partial fills, missing executions, holding overnight positions, running a report from a start date on which I was not flat, and using another platform to place an order. None of that explains what I'm seeing in the screenshots attached below but I'm open to being corrected. I started the week flat yesterday January 28th. No positions are ever held overnight on any of these accounts, yet how is it that when I remove different days from the backtest window and shorten the lookback window, it changes the PnL for January 28th and 29th? Actually, multiple days PnL's are adjusted I'm honing in on Sunday and Monday (today) because it's easy to follow that I didn't have any positions still open over the weekend. It doesn't make sense how this could be right, let alone trusted and if it's not right, why hasn't something been done to fix this?
                  NinjaTrader_PatrickH could you possibly shed some light on this?
                  Attached Files

                  Comment


                    #10
                    Hello Ymcaptial,

                    Thank you for your post.

                    I have submitted this feedback to our Development Team.

                    I will follow up with an internal tracking number for your reference as soon as it is created.

                    Unfortunately, the only workaround would be to have the start date on the day you started the calendar day flat.
                    Spencer F.NinjaTrader Customer Service

                    Comment


                      #11
                      Correct me if I’m wrong but you’re saying the only way that’s ever correct is if you don’t trade globex before midnight?

                      That just seems ineffective. If it can effectively keep track of PnL’s I would think a much better solution would be to make the calendar count trades the same way “Accounts” tab counts trades which is on a per session basis. It’s surprising no one has considered this all these years or maybe I’m just not seeing something blantantly obvious. Why track something based on each day starting on a traditional calendar day (12:00 am to 11:59 pm) if that’s not how the brokerage statements track it and it’s not possible to get an accurate idea of your daily pnl on the trade performance as it is? I’m not mad at you, I just don’t understand why my pnl fluctuates and can’t be realistically tracked via the trade performance window. Thanks.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by MacDad, 02-25-2024, 11:48 PM
                      8 responses
                      171 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Started by alancurry, Today, 06:53 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post alancurry  
                      Started by Juanhuisman, Today, 06:51 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post Juanhuisman  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      173 responses
                      2,338 views
                      0 likes
                      Last Post intelligenttrader  
                      Started by ArkansasClint, 04-25-2024, 09:28 AM
                      1 response
                      23 views
                      0 likes
                      Last Post Leafcutter  
                      Working...
                      X