Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Sharpe Ratio calculation bug
Collapse
X
-
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.Tags: None
-
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.htmBertrandNinjaTrader Customer Service
Comment
-
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
-
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.htmCal H.NinjaTrader Customer Service
Comment
-
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
-
Originally posted by dbooksta View PostAh, 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.
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
-
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 MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
307 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
267 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
||
Started by Mestor, Today, 03:15 AM
|
0 responses
2 views
0 likes
|
Last Post
by Mestor
Today, 03:15 AM
|
Comment