Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sharpe Ratio calculation bug

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

    Sharpe Ratio calculation bug

    There's something wrong with the way you calculate the Sharpe Ratio on Backtest summaries in 7.0.1000.22: Backtesting the same strategy on a single instrument from 1/1/2014 to the present you report a (ridiculous) Sharpe Ratio of 9.73. If I run the backtest from 12/31/2013 to the present I get the same trade set and you report a (more accurate) Sharpe Ratio of 2.53.

    #2
    Hello Dbooksta,

    Thank you for your post.

    Do you get these same kind of results when you use the SampleMACrossOver strategy with the backtest?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Do you get these same kind of results when you use the SampleMACrossOver strategy with the backtest?
      I can't reproduce anything so clearly erroneous using that sample strategy.

      Comment


        #4
        dbooksta, for which market, data provider and timeframe do you see that happen? Would you mind if we reproduced on our end with your script?

        For the Sharpe one needs to keep in mind we per default use a risk free return of 0 in it's calcs, in the more customizable GetSharpeRatio() call you could specify which rate to use in contrast - http://www.ninjatrader.com/support/h...harperatio.htm
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I'm using eSignal as data provider.

          Can't share the strategies I'm working on but I think it should be easy enough to find reproducible bugs in your Sharpe Ratio calculation because they are rampant in the tests I've been doing.

          Let's start with this problem: I just ran the SimpleMACrossOver for 2013 on QQQ. Looking at the Periods tab the Sharpe Ratio for every month is 1.00.

          Comment


            #6
            dbooksta,

            This is expected behavior for the period time of one month. If there is one month or less of data than there is insufficient data to run this calculation and will default to 1.

            Below is a link from the help guide, see the last section for the Sharpe Ratio
            http://www.ninjatrader.com/support/h...efinitions.htm
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Ah, you have bigger problems than I thought: You're computing the Sharpe Ratio of monthly returns. The presumption in finance is that Sharpe Ratio is annualized. For example, your documentation says, "Generally, a ratio of 1 or greater is good, 2 or greater is very good, and 3 and up is great." But that is only true for annualized Sharpe Ratios.

              Since NT always has daily return data you should always compute the Sharpe Ratio of daily returns (as Mean[Excess daily return]/StDev[Excess daily return]) and then multiply by Sqrt[252] to get the annualized Sharpe Ratio.

              Comment


                #8
                Originally posted by dbooksta View Post
                Ah, you have bigger problems than I thought: You're computing the Sharpe Ratio of monthly returns. The presumption in finance is that Sharpe Ratio is annualized. For example, your documentation says, "Generally, a ratio of 1 or greater is good, 2 or greater is very good, and 3 and up is great." But that is only true for annualized Sharpe Ratios.

                Since NT always has daily return data you should always compute the Sharpe Ratio of daily returns (as Mean[Excess daily return]/StDev[Excess daily return]) and then multiply by Sqrt[252] to get the annualized Sharpe Ratio.
                Just thought I'd add a link http://www.investopedia.com/articles...arpe_ratio.asp

                Part of that link offers this tidbit:

                Return (rx)
                The returns measured can be of any frequency (i.e. daily, weekly, monthly or annually), as long as they are normally distributed, as the returns can always be annualized. Herein lies the underlying weakness of the ratio - not all asset returns are normally distributed.

                Abnormalities like kurtosis, fatter tails and higher peaks, or skewness on the distribution can be a problematic for the ratio, as standard deviation doesn't have the same effectiveness when these problems exist. Sometimes it can be downright dangerous to use this formula when returns are not normally distributed.

                Sorry I can't be of further help.

                Comment


                  #9
                  dbooksta, thanks for the feedback. From what I have seen there's multiple calculations and bases out here for the Sharpe and other ratios, we currently do the monthly mode only that is correct. I have your feedback though documented in our product management enhancement lists for future consideration. We're also exploring ways to enhance the support of custom created performance measures in future platform updates, so dedicated coders could further customize those aspects to their likings.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by ketostrongdiet, Today, 12:34 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post ketostrongdiet  
                  Started by ketostrongdiet, Today, 12:33 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post ketostrongdiet  
                  Started by mattdowns1234, Yesterday, 06:57 PM
                  0 responses
                  16 views
                  0 likes
                  Last Post mattdowns1234  
                  Started by dgee949, Yesterday, 06:26 PM
                  0 responses
                  26 views
                  0 likes
                  Last Post dgee949
                  by dgee949
                   
                  Started by dgee949, Yesterday, 05:58 PM
                  0 responses
                  32 views
                  0 likes
                  Last Post dgee949
                  by dgee949
                   
                  Working...
                  X