What is the Sharpe ratio? How to read it, with an example
By Oalgo · Last reviewed
The Sharpe ratio is the average result divided by the spread of those results. It tells you how steady the results were, measured against their size. It does not tell you how large the results were, and it does not say whether the pattern will continue.
How does Oalgo show it?
#Oalgo's backtest results table has a Sharpe column that can be sorted. Oalgo works it out from the account value at the end of each day: it takes the percentage change from one day to the next, divides the average change by the spread of the changes, and multiplies by the square root of 365, because prices trade every day of the year. A day with no new value counts as no change. A test shorter than 30 days shows no Sharpe figure, because so few days say very little.
What is the formula?
#Sharpe = (average daily percentage change ÷ standard deviation of the daily percentage changes) × the square root of 365 in Oalgo's version. The standard deviation is the sample one, which divides by the number of values minus 1. The textbook formula first takes away a risk-free rate from the average; Oalgo's figure leaves that step out, so read it as a measure of steadiness.
What does a worked example look like?
#Five invented values: 2, −1, 3, 0 and 1. Their average is 1. The deviations from the average are 1, −2, 2, −1 and 0, and their squares add up to 10. Divide by 4, the number of values minus 1, to get 2.5. The standard deviation is the square root, about 1.58. The ratio is 1 divided by 1.58, about 0.63. Multiplied by 19.10, the square root of 365, it is about 12.08 on Oalgo's yearly scale.
What can the ratio not tell you?
#A high ratio on a short test can come from a handful of trades, and it says nothing about the stretch that follows. The drawdown shows the size of the fall along the way, which the ratio does not show at all. Read the ratio next to expectancy and drawdown, not on its own. Two sets of values can have the same average and differ widely in spread, and then their ratios differ too. The backtest report shows the other columns to read beside it.
In Oalgo the path runs from your idea in your own words, to rules the AI builds and you check, to a backtest that produces this table, and then a forward test on live prices with simulated funds. Go Live is a separate choice, with your own Live Strategy on your own Venue Account at a Supported Venue.
Read next
- What is drawdown? Maximum drawdown explainedDrawdown is the fall from your account's high point to a later low. See how it is measured, why recovering takes a bigger gain, and how to read it.
- What is expectancy? What one trade is worth on averageExpectancy is what one trade is worth on average, from the win rate and the size of wins and losses. Learn the formula, a worked example and its limits.
- How to read backtest results: a step-by-step guideHow to read backtest results step by step: trades and dates first, then drawdown and fees, and the end result last. Plain definitions of each number.