Forum Applications Trading Strategies (Algo Quant)
How to compute Sharpe ratio for a high frequency multi-asset long/short strategy
-
Ken YiuParticipant 2011-06-02 at 10:26 am
What I have is only a set of trade executions from this strategy. The strategy starts with nothing but is able to borrow money or stocks (for short sell) when needed. How should I compute its returns, and hence the sharpe ratio?
-
Haksun LiModerator 2011-06-02 at 2:14 pm
First, there appears no standard agreement in this subject: http://www.wilmott.com/messageview.cfm?catid=4&threadid=53403
Below is simply my personal opinion.
I think the problem is not about high or low frequency, long or short strategy, single or multi asset. It is about how we interpret the (traditional) definition of Sharpe Ratio (SR).
For instance, as in the traditional setting, if we have a daily pnl, then we can compute SR by
-
compute the average daily pnl
-
compute the standard deviation of the daily pnl
-
compute the SR by dividing the average by the standard deviation
This definition will work as long as we can measure pnl at regularly spaced time intervals, e.g., daily, hourly, etc. This is regardless of the position change over the time intervals.
Now, instead of insisting that the returns be sampled at regular intervals, we allow the definition to include returns be sampled at irregular intervals, even unpredictable intervals, e.g., stopping times, trade times.
Then, for a high frequency trading strategy, we measure the delta return, [tex]dr[/tex] , at each trade time. That is, the returns are the changes in portfolio P&L between the last and this trade times.
We have: [tex]SR = E(dr)/sigma(dr)[/tex]
What do you think?
-
-
Ken YiuParticipant 2011-06-02 at 5:35 pm
Thank you for the detailed explanation.
I think my question should be changed to “how to compute returns for an active portfolio?”.
In order to compute the returns (or differential returns as in Sharpe’s articles http://www.stanford.edu/~wfsharpe/art/sr/sr.htm), you need the original capital [tex]x[/tex], i.e., [tex]R = frac{x’}{x} – 1[/tex] where [tex]R[/tex] is the return, and [tex]x’[/tex] is the new portfolio value.
It’s easy to compute [tex]R[/tex] at regular intervals if the capital for the portfolio is the portfolio value at time 0. However, when the strategy is not a buy-and-hold strategy, but an actively managed portfolio (i.e., capital is actively injected/withdrawn anytime, in other words, [tex]x[/tex] is changing over time), how should one compute the returns at regular (or irregular) intervals?
For example, here are some trades from a strategy: At t1, BUY 1 unit of A at $10 At t2, SELL 2 unit of B at $20 At t3, SELL 2 unit of A at $14 At t4, BUY 1 unit of B at $18 At t5, BUY 1 unit of B at $16 At t6, BUY 1 unit of A at $11
We can still compute the P&L at t1, t2, …, but how should one compute the capital, hence the returns at these time points?
At t1, the capital is $10 x 1 = $10. At t2, the capital becomes $10 + $20 x 2 = $50 (correct? what is the capital for short selling?) At t3, the capital becomes $50 + ($14 x 1 – ($14 – $10) x 1) = $60? …
Should I just find the maximum of the running capital at all time points and take it as the capital? The reason for this is that, I treat all these trades as asset reallocation for a fixed-capital portfolio.
So, suppose the price of A rose from $10 at t1 to $12 at t2, the P&L of the strategy at t2 is $2. Since the maximum running capital of these trades is $60, the return for the period [t1, t2] is $2/$60 = 3.33%
Another problem is that, Sharpe ratio is time dependent. The distribution of the time points does matter the ratio. Comparing 2 SR with different time point distributions seems to be meaningless.
For example, Strategy X: At t1, buy 1 unit at $1 At t2, buy 1 unit at $1 At t3, sell 2 units at $2
Strategy Y: At t1, buy 2 units at $1 At t3, sell 2 units at $2
Suppose t1, t2, t3 are at regular intervals. If we compute SR at regular time points t1, t2, t3, the ratios for both strategies are the same. However, if we compute SR at each trade time, the ratios for these 2 strategies are different. In this case, which one is correct?
What do you think?
-
osigrtoeltParticipant 2011-06-06 at 4:49 am
I think I understand Ken’s concerns. Here’s my two cents worth:
1. (Calculation of Returns) When dealing with a zero-investment strategy (zero outlay and +/-/0 returns), we can always associate an initial notional value [tex]V[/tex] (this could be the maximum allowable short position/capital for this particular strategy or some other sensible values) at the start of the trading period. The percentage return at time [tex]t[/tex] is then calculated as [tex]R_t = x_t / V[/tex], where [tex] x_t[/tex] denotes the absolute return (measured in the same unit as [tex]V[/tex]) at time [tex]t[/tex]. I won’t suggest to use the “maximum running capital”, since unlike in a buy-and-hold strategy, we should only update the value of [tex]V[/tex] when upscaling or downscaling of the zero-investment strategy is required. This will be discussed next and we will see that Sharpe ratio should be SCALE INDEPENDENT.
2. (Scale Independence) To incorporate time varying [tex]V_t[/tex], let [tex]R_t = x_t / V_t[/tex].
a) Sharpe ratio is independent of the initial notional value [tex]V[/tex]. E.g. Assume that the maximum allowable capital for a stategy is $200 and we do not upscale or downscale this strategy, the returns in the first 5 time periods are [tex]x_t = ($2, $1, $5, -$5, $2)[/tex]. If we choose [tex]V_t = 200[/tex], then the Sharpe ratio is 0.5% / 1.84% = 0.272. If we have totally ingored the notional value (i.e. [tex]V_t = 1[/tex]) and used the PnL directly in our calculation (as in Haksun’s post), the Sharpe ratio remains unchanged at 0.272 (= $1 / $3.67). In view of this, we can simply use the PnL (measure in the same unit as V, e.g. dollars) instead of percentage return for a zero-investment strategy, since [tex]SR(R_t) = SR(x_t)[/tex] if we do not upscale or downscale this strategy.
b) Next assume the strategy is scalable (i.e. liquid and very low transaction cost, so that the return is proportional to the capital injection). In this case, as long as we are consistent with our choice of [tex]V_t[/tex], Sharpe ratio is still (scale-)independent of the notional values [tex]V_t[/tex]. Continue with the previous example and consider the following senario for instance: after observing very stable and good performance in the first 3 time periods, the management decides to upscale the strategy by doubling the maximum allowable capital at [tex]t = 4[/tex], so that the monetary returns become [tex]x_t = ($2, $1, $5, -$10, $4[/tex]). We should calculate the Sharpe ratio of this particular strategy by using [tex]V_t = (1, 1, 1, 2, 2)[/tex] instead, as if no upscaling was involved. The returns remain unchanged at [tex]R_t = (2, 1, 5, -5, 2) / V[/tex], which yields a Sharpe ratio of 0.272, same as before.
This also applies when we deal with irregular time intervals.
3. (Time Independence) The beauty of Sharpe ratio is that it’s TIME INDEPENDENT, so that strategies (traded in similar frequencies) over different time horizons can be compared; see Sharpe’s (1966, 1975) original papers for details. I totally agree with Ken that it is meaningless to compare strategies traded at different frenquencies (e.g. compare daily strategies with high-frequency ones). As for Ken’s last example (Stragies X and Y at time [tex]t_1, t_2[/tex] and [tex]t_3[/tex]), there is no single “correct” SR to use, and we should only compare them on the same time scale. E.g. calculate the returns at [tex]t_1, t_2[/tex] and [tex]t_3[/tex] and obtain the annualized Sharpe ratio using these returns and a suitable scaling vector [tex]V_t[/tex].
Please let me know if this answers your questions or if you have other questions/concerns. Thanks.
-
Haksun LiModerator 2011-06-06 at 6:36 am
Thank you Kevin for the ingenious insight.
If I understand you correct, to implement the SR computation, we need to keep track of a running capital [tex]V_t[/tex]. Then, we compute the return [tex]R_t[/tex] at some predetermined time points.
A few question – 1. Where does the [tex]$3.67[/tex] in your discussion come from? Sorry I couldn’t figure it out… :-[
How should we compute the SR for a basket? E.g., we trade a pair of [tex]Z = X – alpha Y[/tex]. Suppose X and Y are traded at different times, as in Ken’s example. So we can compute [tex]SR_X[/tex] and [tex]SR_Y[/tex], how do we “combine” them somehow to compute [tex]SR_Z[/tex]? Or, do we compute [tex]SR_Z[/tex] directly without computing for the individual assets separately?
-
osigrtoeltParticipant 2011-06-06 at 9:53 am
Hi Haksun,
My main point is that [tex]V_t[/tex] changes if and only if we upscale or downscale this particular trading strategy. If [tex]V_t[/tex] is constant, we can simply use PnL to substitute percentage returns ([tex]R_t[/tex] using Ken’s notation). If not, we can still calculate the Sharpe ratio by using PnL divided by scaling factors.
The magnitude of [tex]V_t[/tex] is unimportant – only the relative scaling matters. In my example, we upscale the strategy by a factor of 2 at [tex]t = 4[/tex], so the scaling vector becomes (1, 1, 1, 2, 2). Regardless of whether we calculate returns at regularly spaced time or not, Sharpe ratio should be scale independent.
1. $3.67 is simply the sample standard deviation of ($2, $1, $5, -$5, $2). Sorry, I didn’t define SR explicitly in my previous post.
2. As for a strategy that involves a basket of assets (e.g. pairs trading), we don’t need to calculate the Sharpe ratios of individual assets. We may simply treat them as a whole and calculate the SR for this strategy. E.g. Assume [tex]Z = X – alpha Y[/tex], [tex]alpha = -1[/tex], and the returns from [tex]X[/tex] and [tex]Y[/tex] [tex](t = 1, ldots, 9)[/tex] are listed in the table below:
X: $1 NA $2 NA -$1 NA NA $2 -$1 Y: $1 $1 NA -$1 NA $3 NA -$1 $0
To calculate the SR of the strategy, simple use the sample mean divided by the sample standard deviation of [tex]Z[/tex]:
Z: $2 $1 $2 -$1 -$1 $3 $0 $1 -$1
and [tex]SR_Z = (2/3) / (1.5) = 4/9.[/tex] We can then compare different strategies (traded at similar frequencies) by using annualized (or some other time scales, e.g. daily) SR.
Kevin
P.S. If the strategy is NOT scalable (i.e. the expected monetary return is not proportional to the scaling factor due to low liquidity, large transaction cost, etc), we should treat the scaled strategy as different (competing) strategy rather than using the scaling vector approach described above.
-
Ken YiuParticipant 2011-06-07 at 8:50 am
Thank you Kevin!
In the case of no scaling, the calculation of returns [tex]R_t[/tex] (and scale independence) basically assumes that there is no reinvestment involved, which is quite valid for common high frequency trading strategies.
Then, the implementation in Sharpe Ratio may not be sufficient in this case. Let me implement one that suits this situation.