Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cumulative profit - incorrect calculation

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

    Cumulative profit - incorrect calculation

    when performing a backtest on a 1:1 basis (100k equity vs 100k position size I generate a 32% return, yet Net Profit = 42k in currency terms.

    The same test on a 10:1 basis = 1656% return when taking 10 contracts, but the currency figure = 420k?
    The same test on a 10:1 basis = 32% return when taking 1 contract of 1 million $.

    In conclusion it also is not consistent in the Sharpe ratios it generates?

    Thanks in advance,

    GH

    #2
    Hello,

    Thank you for your first forum post.

    What instrument are you trading?

    How are you getting an exact 100k position size? Did you use By Account Size?

    Can you get the same to occur with the sampleMACrossOver strategy?

    Basically can you please let me know what this occured on so that I can attempt to duplicate this on my end, to see if this is expected or if we have a bug here.
    BrettNinjaTrader Product Management

    Comment


      #3
      Cumulative Profit

      Hi Brett,

      The contract in question is the EURUSD.
      100 k contract size is determined by "quantity" param on back test.

      No, when i use sample ma crossover it generates 35,000 positions on my dataset whereas my code generates 39 positions for 2 years and avg time in market is around 20 days.

      Regards,

      GH

      Comment


        #4
        Hi,

        100k contract size does not necessarily represent using $100k dollars. I am not sure what you mean by testing on a basis of 1:1 or 10:1.

        When you tell a strategy to run with "By quantity" and you punch in 100k for the quantity. That means use however much money it takes to buy 100k. The amount of money to do so could be well over $100k.

        Please see here for how cumulative profit is calculated. It's not as simple as simply converting one to the other:
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Cumulative Profit

          Josh,

          I fully understand that 100k quantity of EURUSD equates to more than 100k USD, this is not the problem.

          When you run a strategy and your starting capital is 100k USD I do not understand why the Cumulative Profit PERCENTAGE CALCULATION seems incorrect.

          So I start with 100K USD and make say 400k profit for the period back tested, this looks more like a 400% cumulative profit percentage not 1600% plus?

          In addition, if you say operate at 10:1 leverage, being 100k capital trading 1 x 1M contracts of EURUSD, the outcome is a totally different Sharpe ratio to say trading 10 x 100k contracts of EURUSD.

          Thank you in advance,

          GH

          Comment


            #6
            Hello,

            Its still unclear as to what exact settings you are using or this may be the source of the confusion.

            To backtest Currencies there are changes that need to be done to use the strategy analyzer then when you trade live.

            Please see the following information for trading FX strategies.



            Also here would be the best way to test, would be to run a strategy that only places a few trades for only 1 day, then calculate it out using the link the josh submitted. You should find that the calculation should match.

            Remember this and this may also be where your confused. Cumulative Profit also considers losing trades. So if your up 1600 percent cumulative profit and you only up 400 percent on the account this means that the most you lost when this strategy was running before it ended at 400 percent up was 1200 percent profit down. Since it had to make that back to end at a 400 percent profit.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #7
              Cumulative Profit %

              Dear Brett,

              Thank you for your reply.
              I read and reread the FX link, thank you, I have been inputting 100k lot sizes as directed from the get go.

              Lets make this a simple process.

              You start with 100,000 dollars of equity in your simulated account.
              You generate a net profit of 400,000 AFTER Gross Profit and Gross Losses are netted to give you Net Profit.

              Does the 400,000 Net Profit you generated represent a +/- 400% return or a 1600% return? If you need to see a screen pic I can do so if this still does not gel for you?

              Thanks in advance,

              GH.

              Comment


                #8
                Hello,

                Based on your scenario Net profit is 400 Percent. Cumulative Profit is unknown with what you submitted since you dont know how much was lost when the strategy traded. Cumulative Profit does not equal Net Profit.




                Let me know if I can be of further assistance.
                Last edited by NinjaTrader_Brett; 05-28-2010, 09:55 AM.
                BrettNinjaTrader Product Management

                Comment


                  #9
                  Cumulative Profit %

                  Brett,

                  If the strategy back tests with:
                  Gross Profits = 600k
                  Gross Losses = 200k
                  Net Profit = 400k

                  Surely Gross Losses represent what was lost?
                  The dollar amount of the calculation is spot on, its the percentage that is off.

                  GH

                  Comment


                    #10
                    Hello,

                    I have talked with a member of our level 2 support department and dont believe there is a bug here.

                    Levered Positions will effect a Percentage calculation. Have you tried looking at a Cumulative Profit Graph to see if this sheds any light for you on what is going on here.
                    BrettNinjaTrader Product Management

                    Comment


                      #11
                      Cumulative Profit "%" Calculation

                      Hi Brett,

                      The Cumulative Profit on a Currency basis calculates perfectly.

                      I ran the test and used the results in "Currency Mode" for 1 graph and for "% mode" for the other. I cannot see how this can be correct?

                      Let me know your thoughts?

                      Regards,

                      GH
                      Attached Files

                      Comment


                        #12
                        Hello,


                        Percentage is the Percentage of the trade and not your account, I think this is where the confusion is coming in. Percentage is used normally in stocks where when you buy 100 dollars of stock at it goes up 5 percents that equates to a 1 to 1. 5 percent increase in your amount invested in the stock therefor they would be the same in this instance. However with futures/Currencies where you are in a leveraged position where a 5 percent gain in the ES or EURUSD does not equal 5 percent in your PnL. Therefor the percentage gained is not related to the account value. This is why the percentage gained will be different and not relate to the account value.

                        Hopefully that clears things up for you.
                        BrettNinjaTrader Product Management

                        Comment


                          #13
                          Cumulative Profit %

                          Dear Brett,

                          It just does not make sense to me, maybe I am a little slow. I am not trying to be difficult but it is just not possible to have 2 graphs of the same data with 2 such disparate results???

                          If the analysis statistics are there to report on the entire strategy performance then the Cumulative Profit "Currency" and "Percentage" should be based on the same data?

                          Profit is calculated as the amount you gain from a trade, and then added to your PNL?

                          So if you are generating a return of X in currency mode and it relates to your performance relative to starting capital then how come % is different?

                          GH

                          Comment


                            #14
                            Hello,

                            No problem, it may be best if you send a note to support at ninjatrader dot com and put ATTN: Brett and reference this forum post so that I can discribe this to you over the phone really quick, as I think this will be the best way to get this figured out for you. Please provide your land line phone number and a good time to call you in EST.

                            I look forward to assisting you further.
                            BrettNinjaTrader Product Management

                            Comment

                            Latest Posts

                            Collapse

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