Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in calculation of max drawdown on backtest?

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

    Bug in calculation of max drawdown on backtest?

    I believe there is a bug in the way that max DD is calculated when optimizing. The attached file shows (from a VERY curvefitted strategy!) a supposed max DD of 11.06%. But the results in the trades below clearly show that the DD reached 21% in December 08.

    I downloaded all the trades to a spreadsheet and did the math myself. I used the formula

    (max cumulated profit - cumulated profit)/(max cumulated profit) * 100

    for the DD. This showed the max DD was actually about 26%.

    Since I use (Net Profit / Max DD) as a metric for optimizing, this is a serious problem for me.

    Or am I wrong?
    Attached Files

    #2
    Hi unSane, the DD in the lower screen portion list refers to the weekly (Period setting) % DD.

    The Max. Drawdown refers to the complete history of the strategy.

    Maybe this link is also helpful - http://www.ninjatrader-support.com/H...xDrawdown.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      How can it be possible to have a 20% drawdown in a week, but for the maximum drawdown to be 6%?

      How do you arrive at the % figure? What is it a percent of?

      Is the problem that you are arriving at your max % drawdown by scaling the max drawdown in currency to the final equity in currency?

      To see why this is a problem consider the following series:

      Code:
      Equity[0] = $100,000         <-- starting equity
      Equity[1] = $50,000           <-- $50,000 drawdown, or 50% 
      Equity[2] = $200,000
      Equity[3] = $140,000         <-- $60,000 drawdown, or 30%
      Equity[4] = $300,000
      Equity[5] = $500,000
      Equity[6] = $400,000         <-- $100,000 drawdown, or 20%
      The correct figures are:

      Max Drawdown = $100,000 (at bar 6)
      Max % Drawdown = 50% (at bar 1)

      Note that these are NOT on the same bar so you can't calculate the max % drawdown simply by rescaling the max drawdown, which is what the optimizer appears to do.

      Please tell me if I'm wrong. How would the optimizer report the % drawdown in this case?

      Originally posted by NinjaTrader_Bertrand View Post
      Hi unSane, the DD in the lower screen portion list refers to the weekly (Period setting) % DD.

      The Max. Drawdown refers to the complete history of the strategy.

      Maybe this link is also helpful - http://www.ninjatrader-support.com/H...xDrawdown.html

      Comment


        #4
        unSane,

        There are some Max Drawdown related bugs pending for resolve in NT7. Please try again after then. Thank you for your patience.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ok, that's what I thought.

          Would it be helpful if posted an optimizer type for real % drawdown? I also have one for Net Profit / Max % Drawdown and am working on one for RINA which is

          Net Profit / ( Max % Drawdown * % time in market)

          Comment


            #6
            unSane,

            Thank you for the offer. At this point in time I do not think it would be necessary.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by funk10101, Yesterday, 09:43 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by TheWhiteDragon, 01-21-2019, 12:44 PM
            5 responses
            551 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by rtwave, 04-12-2024, 09:30 AM
            5 responses
            37 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by funk10101, Today, 12:02 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by GLFX005, Today, 03:23 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X