Calculating Sharpe
Author: fritz
Creation Date: 5/6/2010 9:55 AM
profile picture

fritz

#1
I'm having trouble trusting the Sharpe calculation on the Performance tab. For example it's showing a negative Sharpe for many tests that show a positive profit, even though "Apply Interest Rates" is turned off. That can't be right.

It also frustrates me that I can't optimize on Sharpe (unless I'm missing something?). So I'd like to be able to calculate my own Sharpe value, so at least I can dump out Sharpe for each test and analyze that.

Except... can I do that, inside the WealthScript? I don't think there's any way to access the equity curve except in a PosSizer.

What are my options here?
profile picture

Eugene

#2
QUOTE:
I'm having trouble trusting the Sharpe calculation on the Performance tab.

I could have agreed with you when talking about the By Period tab. Currently, the calculation there is using a hard coded "risk free" rate of return of 5.0%. This bug will be fixed in upcoming release.

But the Performance tab sounds new. Can you help reproduce what you see using some built-in strategy?
QUOTE:
It also frustrates me that I can't optimize on Sharpe (unless I'm missing something?).

That's right. However, to optimize on monthly Sharpe you can use Community.Scorecard where you'll also find many custom and community-requested peerformance metrics. Its code is open source: you're free to add custom metrics.
profile picture

fritz

#3
Yes, it's easy to reproduce. I just picked the first built-in strategy -- Breakouts / Bandwagon Trade -- and ran it on AA daily, 1/1/04 to today, 10% of equity. Commissions, slippage, interest rates all turned off. Starting with $10000 equity it made a small profit of $13.98 but the Sharpe is -0.82. Neo Master on HPQ made $433.16 but the Sharpe is -0.22. It seems that most systems that make a modest profit are showing significant negative Sharpes. Maybe it's still using some risk-free rate?

Glitch Index on MCD made $662.58 and the Sharpe is +0.01.

Running it on exactly 1 year of data, the Sharpes are closer to what I expect. The longer test seems to mess it up??

Aha. Thanks for the pointer to Community.Scorecard. I'd seen that but didn't know how to use it. I just chose it in the Results tab *before* running the optimization and now I have all those lovely metrics. :)
profile picture

Eugene

#4
Thank you, we'll have a closer look.
QUOTE:
I just chose it in the Results tab *before* running the optimization and now I have all those lovely metrics. :)

Yes, it can be somewhat counter-intuitive but optimizations run over one scorecard (selected in the dropdown list before executing) at a time.
profile picture

fritz

#5
Is there any way to set Community.Scorecard as the default so I don't have to choose it every time?
profile picture

Eugene

#6
No. The first installed scorecard will be selected by default.
profile picture

Cone

#7
It seems that the bug with Sharpe Ratio applying the specified "Return rate for uninvested cash" is still squirming around. It was supposed to have been fixed in 5.5.

For the time being, make sure to enter 0 for the return rate even if "Apply interest rates" is not enabled.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).