Sharpe Ratio for risk adjustment

238 views
Skip to first unread message

dyno

unread,
Sep 10, 2008, 11:36:44 PM9/10/08
to JBookTrader
The current performance index is some what redundant because it can be
derived from profit factor. it is equal to 100% * (f-1)/(f+1) where f
is profit factor. If profit factor is 1.5, you will see a performance
index of 20%

I suggest to add Sharpe Ratio for risk adjustment as a new risk index
or as a replacement for the old performance index.

Sharpe Ratio = average profit per trade / standard deviation of all
the gain and loss

The standard deviation represents the risk. If the gain/loss
distribution is Gaussian, cumulative distribution function can be used
to determine the profit possibility. For example, if Sharpe Ratio is
1, the possibility of loss in a trade is (1-2 * 34.1%) / 2 = 16%.

Kelvin

unread,
Sep 11, 2008, 1:45:46 AM9/11/08
to JBookTrader
I agree the current PI is a function of PF.

The useful thing is the standard deviation PER DAY, because different
strategies have different frequent of trading.

nonlinear5

unread,
Sep 11, 2008, 5:12:53 PM9/11/08
to JBookTrader
Yes, performance index (PI) is redundant. The problem with Sharpe
Ratio is that it doesn't take an opportunity cost into account. For
example, compare two strategies:
Strategy A: 1000 trades, average profit per trade is $100, standard
deviation is $200, Sharpe's Ratio is 0.5
Strategy B: 100 trades, average profit per trade is $100, standard
deviation is $200, Sharpe's Ratio is 0.5

As can be seen, strategy A would make 10 times the net profit
compared to what strategy B would make, even though their Sharpe's
ratios are the same. To correct this problem, we could make an
adjustment that Kelvin suggested, but I am not sure if it makes
statistical sense.

Dyno Brium

unread,
Sep 11, 2008, 8:38:09 PM9/11/08
to jbook...@googlegroups.com
It is simple to adjust to daily risk.
 
Sharpe's Ratio based on risk per day = average profit per day / average STD per day
 
where
 
average STD per day = average STD per trade * sqrt(trades per day)
 
Sharpe's Ratio based on risk per day = sqrt(trades per day) * Sharpe's Ratio based on risk per trade 
=  sqrt(trades per day) * average profit per trade / standard deviation of all the gain and loss
 
correct me if I am wrong

nonlinear5

unread,
Sep 11, 2008, 8:50:02 PM9/11/08
to JBookTrader
> =  sqrt(trades per day) * average profit per trade / standard deviation of
> all the gain and loss

In this formula, is "average profit per trade" taken over all the
trades in the entire period? And "trades per day" is total trades
divided by the total number of days?

Dyno Brium

unread,
Sep 11, 2008, 8:51:24 PM9/11/08
to jbook...@googlegroups.com
correct

nonlinear5

unread,
Sep 11, 2008, 9:03:36 PM9/11/08
to JBookTrader
> correct

OK, in the next release PI will be calculated as Dyno suggested:
PI = SQRT(trades / days) * aveProfit / STDV

where
trades = number of trades in the test period
days = number of days in the test period
aveProfit = average profit per trade over all the trades in the test
period
STDV= standard deviation of all the trades in the test period

For accuracy, I'll also note that this is not really Sharpe's ratio.
First, Sharpe's ratio deals with percentage returns, and second it
also uses risk-free rate of return. However, for our purposes (of
comparing strategies with each other), I think PI will be
representative and useful.

Kelvin, do you also agree with this formula?

Kelvin

unread,
Sep 11, 2008, 9:47:46 PM9/11/08
to JBookTrader
Correct! This is what I mentioned before as Sinal to noise ratio
(SNR), which is the optimal criterion in continuous gambling
system( Kelly criterion is only optimal for discrete gambling). I
totally agree with this fomula to calculate PI.

nonlinear5

unread,
Sep 11, 2008, 10:14:11 PM9/11/08
to JBookTrader
> Correct! This is what I mentioned before as Sinal to noise ratio
> (SNR), which is the optimal criterion in continuous gambling
> system( Kelly criterion is only optimal for discrete gambling). I
> totally agree with this fomula to calculate PI.
>

OK, cool. One remaining thing that I am wondering about is whether we
really need to count days. Since SQRT(trades / days) equals
SQRT(trades) / SQRT(days), the *ratio* of PI(strategy1) and
PI(strategy2) will be exactly the same, no matter if you include the
number of days in the formula or not. So, it seems to me that for
comparison purposes, we can reduce our formula to

PI = SQRT(trades) * aveProfit / STDV

What do you guys think?

Kelvin

unread,
Sep 11, 2008, 10:28:15 PM9/11/08
to JBookTrader
No, that is not correct. For example, currently TickFader has much
less trading days, but it has close profit to Balancer.
In the SNR criterion, TickFader should be much better than Balancer.

nonlinear5

unread,
Sep 11, 2008, 10:39:53 PM9/11/08
to JBookTrader
> No, that is not correct. For example, currently TickFader has much
> less trading days, but it has close profit to Balancer.
> In the SNR criterion, TickFader should be much better than Balancer.
>

Well, yes, if the number of trading days is not the same, then the
simplified formula will not work. OK, fine, we'll go with the Dyno's
original formula then.

Kelvin

unread,
Sep 11, 2008, 10:59:44 PM9/11/08
to JBookTrader
I think 5.08 will be a great version.

nonlinear5

unread,
Sep 12, 2008, 7:33:35 PM9/12/08
to JBookTrader
I am going to make a small adjustment to the formula as follows:
PI = 100 * SQRT(trades / days) * aveProfit / STDV

The multiplication by 100 is to make the PI more readable. So, instead
of, say, 0.96, what will be reported is 96.

Mike Thornton

unread,
Sep 23, 2008, 3:24:15 AM9/23/08
to jbook...@googlegroups.com
The above definitions for Sharpe ratio are not quite correct.  The Sharpe ratio is a measure of excess return over the risk free rate (which is usually taken as LIBOR) normalized by the volatility of the trading algorithm.  Furthermore, the numbers used in the numerator and denominator are not absolute values, but percentages.  The sharpe ratio adjusts for cost because the return is expressed as a percentage and not as an absolute number.

Sharpe Ratio = (return - risk free rate)/volatility
return = your return as a percentage
risk free rate = London Interbank Offering Rate (LIBOR) - the interest rate banks charge each other for lending
volatility = standard deviation of returns, as a percentage

So for instance, if your strategy returns 23% over 1 year with a volatility of 10%, and taking LIBOR to be 3% then your sharpe ratio is

SR = (23 - 3)/10 = 2

Note that when comparing sharpe ratios between strategies that the time periods for the calculation must be the same in order to compare apples with apples.


nonlinear5

unread,
Sep 23, 2008, 5:20:54 PM9/23/08
to JBookTrader
> The above definitions for Sharpe ratio are not quite correct.  The Sharpe
> ratio is a measure of excess return over the risk free rate (which is
> usually taken as LIBOR) normalized by the volatility of the trading
> algorithm.  Furthermore, the numbers used in the numerator and denominator
> are not absolute values, but percentages.  The sharpe ratio adjusts for cost
> because the return is expressed as a percentage and not as an absolute
> number.
>
> Sharpe Ratio = (return - risk free rate)/volatility
> return = your return as a percentage
> risk free rate = London Interbank Offering Rate (LIBOR) - the interest rate
> banks charge each other for lending
> volatility = standard deviation of returns, as a percentage
>

Right, as I noted above in this thread, PI is not the same as Sharpe's
ratio. However, it measures the same thing, in essence, which is
performance adjusted for risk. While it's not very meaningful by
itself, PI is a good metric to go by when *comparing* multiple
strategies over the same period of time. This is exactly what
optimizer does, so PI is good for this purpose.

rickty

unread,
Sep 23, 2008, 5:54:06 PM9/23/08
to JBookTrader
"This is exactly what
optimizer does, so PI is good for this purpose. "

Incidently, PI is very close to Van Tharp's SQN (system quality
number),
which he uses to compare systems.

nonlinear5

unread,
Sep 23, 2008, 7:50:26 PM9/23/08
to JBookTrader
> Incidently, PI is very close to Van Tharp's SQN (system quality
> number),
> which he uses to compare systems.
>

I was looking for a reference to SQN to see how it's calculated, but
could not find the actual formulas. Got a link, rickty?

dyno

unread,
Sep 23, 2008, 10:11:02 PM9/23/08
to JBookTrader
The idea is provide risk reward ratio as a tool for strategy
comparison. The closest term I can find is Sharpe Ratio, that's why I
brought it here and made modification for strategy comparison.

dyno

unread,
Sep 23, 2008, 10:25:08 PM9/23/08
to JBookTrader


On Sep 23, 7:50 pm, nonlinear5 <eugene.kono...@gmail.com> wrote:
C&P from http://www.ninjatrader-support.com/vb/showthread.php?t=4320

The only way to seriously qualify and optimize any system is through
its System Quality Number (SQN). I advice you to refer to Van Tharp
for reference on the subject.

Assuming a set of N trades (N>30 for being statistically significant),
SQN is defined as follow:

SQN= Squareroot(N) * Average (of the N Profit&Loss) / Std dev (of the
N Profit&Loss).

The large the N, the more trading opportunities you have.
The large the average P&L, the better you are obviously.
The smaller the Std dev (P&L), the more regular are your results and
the smaller are the drawdowns.

Note here that if you optimize for the largest SQN, you maximize in
fact the product N*average P&L and you minimize the Std dev (P&L) and
the drawdowns at the same time.

nonlinear5

unread,
Sep 23, 2008, 10:40:19 PM9/23/08
to JBookTrader
>
> SQN= Squareroot(N) * Average (of the N Profit&Loss) / Std dev (of the
> N Profit&Loss).
>

Ok, yes, this is identical to PI, with the exception that we take the
square root of (N/days), instead of square root of N. So, it seems
like we are thinking in the same direction with Van Tharp.

rickty

unread,
Sep 24, 2008, 3:34:27 AM9/24/08
to JBookTrader
nonlinear,

"Got a link, rickty?"

Sorry no link; Tharp talks about SQN in his new book.

rickty

unread,
Sep 24, 2008, 5:16:54 PM9/24/08
to JBookTrader
I've attached a copy of a couple of pages from Tharp's newest book
where he gives the definition of SQN and also discusses a problem
with it and his solution.

Richard

http://jbooktrader.googlegroups.com/web/SQN_tharp.pdf?gsc=evpNyBYAAAB8olMf4Zv3DbW_0xlPp6Ue5QzTRg0a_4LqA7LDDLzsAA

nonlinear5

unread,
Oct 11, 2008, 1:24:06 AM10/11/08
to JBookTrader
Starting from JBT release 6.01, the PI is calculated the same as SQN:
Reply all
Reply to author
Forward
0 new messages