Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sharpe Ratio calculation bug

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

  • NinjaTrader_Bertrand
    replied
    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.

    Leave a comment:


  • Tasker-182
    replied
    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.

    Leave a comment:


  • dbooksta
    replied
    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.

    Leave a comment:


  • NinjaTrader_CalH
    replied
    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

    Leave a comment:


  • dbooksta
    replied
    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.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    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 - https://www.ninjatrader.com/support/...harperatio.htm

    Leave a comment:


  • dbooksta
    replied
    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.

    Leave a comment:


  • NinjaTrader_CalH
    replied
    Hello Dbooksta,

    Thank you for your post.

    Do you get these same kind of results when you use the SampleMACrossOver strategy with the backtest?

    Leave a comment:


  • dbooksta
    started a topic Sharpe Ratio calculation bug

    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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Perr0Grande, Yesterday, 08:16 PM
1 response
7 views
0 likes
Last Post NinjaTrader_Jesse  
Started by f.saeidi, Yesterday, 08:12 AM
3 responses
24 views
0 likes
Last Post NinjaTrader_Jesse  
Started by algospoke, Yesterday, 06:40 PM
1 response
14 views
0 likes
Last Post NinjaTrader_Jesse  
Started by quantismo, Yesterday, 05:13 PM
1 response
14 views
0 likes
Last Post NinjaTrader_Gaby  
Started by The_Sec, 04-16-2024, 02:29 PM
3 responses
16 views
0 likes
Last Post NinjaTrader_ChristopherS  
Working...
X