Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawdown calculation

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

    Drawdown calculation

    Hello,
    I’m trying to understand how NT calculates drawdown. Actually I know how it does from here http://www.ninjatrader.com/support/h...efinitions.htm but I have very deep misunderstanding anyway.
    I have applied SMACrossOver System to AA daily chart from 01.08.11 until 20.01.12 with the default size of 1 share.
    In the attached pictures you can see both Equity curve in currency and in percent. According to picture 1, the equity high was $2.1 and after that was a retracement and a low of $1.13, which gives us a percentage drawdown of -46.19% (1.13/2.1-1)*100.

    But changing the calculation mode Percent gives Drawdown of -11.05% (see picture 2), which is a huge difference.

    I think that such calculation of DD is incorrect and runs counter to the norms of the calculation of this coefficient.

    My question is: is there a way to calculate DD in % while applying Currency calculation method? This is a very important issue for me.
    May be there is a way to do it through a strategy code?

    Also, is it possible to calculate some coefficients, like CAGR and others according the Initial Cash value in Simulator tab in Options?

    Thank you very much.
    Attached Files

    #2
    Hello,

    I am confirming the answer on this with development and will let you know.

    I believe where the mis understanding here is that with NinjaTrader Strategies there really is no concept of account size. You simply start at 0 and your PnL adds or subtracts to get to your end PnL at the end of the strategy running.

    Therefor with NinjaTrader when using the percent mode you cannot think of it from an account standpoint.

    You must think of it as follows, what I am clarifying is if this aspect of thinking also applies with Max Drawdown as it does with Cumulative profit.

    Cumulative Profit in Percent Mode
    Cumulative Profit % mode can be thought of as if you were reinvesting your complete account including winnings back into the trade again and again.

    Consider you start with $1 and you made 3 trades at profits of 25 cents, 50 cents, and 75 cents. That would mean the trade's percent profit was 25%, 50%, and 75%. What % mode does is it weighs each of these percentages in from a reinvestment standpoint.

    Trade 1 = 25%. 25% of $1 = we made 25 cents.
    Trade 2 = 50%. 50% of $1 + $0.25 = 50% of $1.25 = $0.625
    Trade 3 = 75%. 75% of $1.25 + $0.625 = 75% of $1.875 = $1.40625

    This means after all 3 trades we would have made $0.25 + $0.625 + $1.40625 = $2.28125.
    Since we started with $1, winnings of $2.28125 is equivalent to a Cum. Profit % of 228.125%

    You can see that 228% cumulative profit is not equivalent to Total Net Profit which is just $1.50 or 150% if taken from a summation only standpoint.

    Comment


      #3
      Thank you for your reply. Before i can you give you answer to your previous post, I have one more question:

      I applied the same strategy on the same chart, but I changed Set Order quantity to "by account size" and choose account size of $10.

      After that I clicked Run backtest.
      As you can see in my attached image, on some trades NT buys 100 shares of AA (on those where the entry price is greater than 10) and on some trades NT buys 1 share (where entry price is less than 10).

      According to my logic, NT mustn't take the first trade at all because of insufficient funds. But what NT does - it buy 100 shares or puts 1226 dollars into the trade.

      What can you say about this? Is it ok to trust NT results after that?
      Especially i'm surprised with Net Profit of $265.41 or 265%
      IMO it's not.

      Hope you can explain it to me.

      Thanks in advance.
      Attached Files

      Comment


        #4
        Hello,

        I have analyzed your example and I still have questions.

        First, how does "account by size" works? Why it allows to take trades when there is now cash for entry and even more, how does NT calculated to buy 100 shares of AA and then suddenly changed it to 1 (please see my previous post)?

        As for you example and DD and Cumulative Profit calculation. I fully understand and absolutely agree with NT calculation of DD and CumProfit when Currency mode is activated.

        But I disagree with the calculation of DD when in Percent mode. Even if there is no such definition as an Account Size or Starting Capital in NT.

        First of all, take a look at my attached pictures of trades and summary of the same SMA CrossOver system applied to AA on both modes: Currency and Percent.

        As you can see, during Currency mode I made a Cum(Net).profit of $1.97. That’s ok.
        $DD was 0.97, which was made during the trades 9-10. If you look at Cum.Profit chart, you can manually calculated %DD as (1.13/2.1-1)*100 which is 46.19%.

        That is the only way to find percentage DD for my equity and it actually doesn’t matter what was the Starting capital.

        Now, take a look at Percent mode Summary, Trades and Chart.

        As you said, NT everytime starts a backtest simulation from 0 account size. According to the Summary tab in Percent Mode I made the same $profit of 1.97 but my Cumulative Profit is only 13.96%. NT calculates that %CumProfit as the sum of products of each trade.

        According to your example and assuming that my Account Size is $1 my CumProfit in % should be (1.97/1-1)*100 or 97% but not 13.96% according to Summary report.
        Calculation of %Cum.Profit based on the sum of products of each trade is incorrect and this leads to the unrealistic results of testing.

        The same is with the %DD. NT calculates %DD as the sum of the products of the largest consecutive losing streak. In my example DD was calculated on trades 8 and 9 as a (0.9761*0.9113=0.8895-1=0.11048*100~11.05%).

        That’s again absolutely incorrect and can lead to very deep mis understanding of system backtesting results and what to expect in futures, applying the system to real account.

        Look again, real %DD while in currency mode is 46.19% while in Percent mode is only 11% which assumes that if I begin trading this SMA System with just 1 contract I can expect only 11% DD, but in reality %DD of 46% with this system can be achieved very easily.

        So, my question remains the same: how can I see real %DD in Backtesting. Is it possible with Currency mode? Is it possible using the strategy code?
        Or I have to manually find my %DD, %Cum.Profit through Excel?

        Are you planning to enhance NT Strategy Analyzer adding the ability to Choose Starting Capital, % of Equity, Max Percent Risk and apply different Position Sizing techniques (something like Wealth-Lab, MultiCharts, RightEdge and other platforms do)?

        Hope to hear from you.
        Thank you very much.
        Attached Files

        Comment


          #5
          One more very "interesting" case.

          The same SMA Crossover strategy, on AA, but from 01.08.00 until 20.01.12, default quantity 1.

          According to the Currency Mode my Net/Cum. profit for that period is $0.09, but according to Percent Mode my Cum.Profit - 46.18%.

          Here is the question: can I say that SMA CrossOver strategy profitable over that period? At what number should i look?



          Please, see attached images
          Attached Files
          Last edited by vsn_103; 02-01-2012, 07:47 AM.

          Comment


            #6
            Hello,

            I'm still checking on this and will report back with finding shortly.

            However I believe the moral of the story is that percent mode simply does not work as most people think it works. it has a different mechanic that you are not factoring into your calculations. Due to this I would recommend using the Currency mode.

            -Brett

            Comment


              #7
              Brett, thank you for your efforts. Hope you and your developers can the shed the light on this very important question.

              I'd also like to hear or read why the Percent mode"doesn't work as most people think" and what different mechanic/logic it has. What was the reason for this mechanic?

              Using Currency mode actually didn't show the full picture of backtesting, I would even say that it is only shows a Raw profit, it is not the way that can show real backtesting coefficients or performance measures on which I can rely on (see my DD example).

              Anyway, thanks again for your assistance and I hope you can bring my comments and concerns to the development team. This is a very important issue.

              Comment


                #8
                Hello,

                Thanks for your patience.

                Alright so how it works for Max DrawDown for example and then you can take it from there.

                It take the Max cum profit high and the lowest cum profit value and subtracts the two. This give you your Max DrawDown.

                Assume 900 cum profit max and a 512.50 cum profit min, subtract these two values gives you 387.50. 387.50 is the Max Draw down.


                Turned into percent mode you take the same values in percent.

                900 cum profit in this case would be 1.42% and the 512.50 would be 0.80%.

                Subtract these two percentages give you 0.62 percent which would be the max draw down in percent mode.

                If you were to graph this 387.50 would be graphed in max draw down mode and 0.62 percent would be graphed.

                There reason why percent mode doesnt work as intially thought is majority think of it as percentage of the account and its relation.

                Insteaad its always used in NinjaTrader as starting from 0 and assuming full reinvestment of the PnL.

                There are currently no changes coming to this method in the short term however in the long term development is reviewing making these enhancements to the strategy analyzer.

                -Brett

                Comment


                  #9
                  Hi,

                  As for Max DD in Curr.Mode absolutely agree.

                  I couldn't understand this "900 cum profit in this case would be 1.42% and the 512.50 would be 0.80%" How did you find 1.42% and 0.8%?

                  Comment


                    #10
                    This is achieved with this explination on how NT calculates in percent mode, this is just the numbers I had when I was in my back test.

                    Cumulative Profit in Percent Mode
                    Cumulative Profit % mode can be thought of as if you were reinvesting your complete account including winnings back into the trade again and again.

                    Consider you start with $1 and you made 3 trades at profits of 25 cents, 50 cents, and 75 cents. That would mean the trade's percent profit was 25%, 50%, and 75%. What % mode does is it weighs each of these percentages in from a reinvestment standpoint.

                    Trade 1 = 25%. 25% of $1 = we made 25 cents.
                    Trade 2 = 50%. 50% of $1 + $0.25 = 50% of $1.25 = $0.625
                    Trade 3 = 75%. 75% of $1.25 + $0.625 = 75% of $1.875 = $1.40625

                    This means after all 3 trades we would have made $0.25 + $0.625 + $1.40625 = $2.28125.
                    Since we started with $1, winnings of $2.28125 is equivalent to a Cum. Profit % of 228.125%

                    You can see that 228% cumulative profit is not equivalent to Total Net Profit which is just $1.50 or 150% if taken from a summation only standpoint.

                    Comment


                      #11
                      Brett, let's leave it as it is. But please bring my comments and my concerns to the developer team.

                      Also, i request new feature: Portfolio simulation with the ability to define Starting capital and different position sizing techniques (such percent of capital, percent risk and others), something like Wealth-Lab and RightEdge does.

                      Also, please take a look at my posts #3 and 5 again and give you comments.

                      Comment


                        #12
                        Hello,

                        Thanks for the requests I will forward it and already have.

                        As far as the account size it simply calculates your contract size by the account size with the maximum number of shares that can be purchased.

                        I would recommend checking the code first to make sure you have not manually specified any QTY in your Enter commands.

                        -Brett

                        Comment


                          #13
                          Thanks for forwarding my requests. It's an important issue not only for me, but for other users too.

                          I'm using default NT @SMA CrossOver and I can't modify it and I still don't understand why NT with an account size $10 allows to buy 100 shares of AA, then it reduces it 1, then again 100...
                          What does NT try to do? What logic is here? Hope you can explain this logic.

                          Thanks in advance.

                          Comment


                            #14
                            Hello,

                            I tested and saw the same.

                            I have asked development to look into that as I cannot see the explanation on why that would occur.

                            Comment


                              #15
                              Still makes no sense

                              It has been well over a year and the NT calculation for percent drawdown does not work according to NT documentation or the statements made by NT on this thread. I have attached a spreadsheet exported from the NT trade list and then performed all drawdown calculations for all trades as they take place. You will see all the regular columns that NT generates and then columns U, V, W, and X are ones I added.

                              These columns (U, V, W, X) are: Peak, Valley, Draw and %Draw. The Peak is the equity highs, the Valley are the equity lows, thus Draw = Valley - Peak. This calculation matches exactly with NT, as it has an equity max drawdown of $9198.

                              %Draw is attempting to do what NT states is the %Draw calculation. For this strategy NT calculated -11.77% which corresponds to absolutely nothing on this spreadsheet. The explanations on this thread also make no sense. I would suggest NT analyze the spreadsheet, which took about 5 minutes to create, and put in the formula that is being used right now in NT for percent drawdown, and post it again. Then we can resolve what has been a very long process and get some finality.

                              If NT discovers that for futures this calculation doesn't have meaning, then it would be best to put that in the documentation, or even better don't generate a wrong number for this field and just put 0. It is far worse to put a wrong number for this value.

                              And note that I don't mean to be testy, but the responses to others who have questioned the calculation has been less than supportive. Sometimes it appears like formulas are thrown out to get rid of the discussion rather than solve the real problem. In this case there really is a problem, either in documentation or the formula.
                              Attached Files
                              Last edited by tradetree; 05-03-2013, 03:44 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              11 responses
                              3,227 views
                              0 likes
                              Last Post xiinteractive  
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              440 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post FAQtrader  
                              Working...
                              X