Back to Community
Ex Japan Asia ETF Arbitrage

Any ideas please to improve alpha and reduce drawdowns?

10 responses

A more realistic back test with 1 cent per share transaction costs and schedule function to trade at market open.

Clone Algorithm
59
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 548fdd40885aef0901a37d96
There was a runtime error.

And finally optimized version.

Clone Algorithm
59
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 548fe66a885aef0901a3c3fa
There was a runtime error.

Thanks Pavy,

Would you be willing to provide a descriptive outline of this algorithm? Also, is it based on a published strategy? If so, is there an accessible reference? How did you pick the list of securities? Etc.

Also, your code has:

def handle_data(context, data):  
    pass  

Normally, I put code in handle_data, but I can see the advantage of structuring the algorithm as you did. I gather that myfunc(context, data) takes its place, and is called according to schedule_function. Is this correct?

Grant

When run from July 2008 (caveat, some of these ETFs didn't exist then).

Clone Algorithm
0
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5491b565e3c061091ee20de2
There was a runtime error.

Alpha. Hmm, maybe that's what "seekingalpha" refers to. Feel free to describe what it means, maybe an example. Quote following from thestreet.com and I don't understand it well if at all:

""Alpha" tells you how a fund is actually doing compared to its "beta" (a volatility measure that is supposed to give you some sense of how far the fund will fall if the market takes a dive and how high the fund will rise if the bull starts to climb). If the beta is 1.5, and the fund rises 15% more than the market, then the alpha is zero."

Clone Algorithm
1
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5491b594e74643090d1688f8
There was a runtime error.

"Alpha" refers to the intercept component of the CAPM regression ("Beta" being the coefficient of the independent variable in that same formula). That regression basically attempts to explain the change in price of an asset as driven by the change in price of the market (since it is a single variable regression, any change in price not explained by change in the market must be "Alpha" as there are no other variables included to explain it). More here: http://en.wikipedia.org/wiki/Alpha_%28investment%29

Thanks for you replies. Here is an overview of strategy. I borrowed ideas from several papers but the basic idea is to use principal component regression to identify if a stock is above or below regression line. The next step is to decide if we long/short the stock based on whether its above/below regression line. In this version, I attempted to use a vol signal and intercept of regression to identify which way to trade. Later, I will test these signals on each stock (instead of complete basket) to see how they perform. This version runs from 2008. Also simplified code a bit and removed redundant bits.

I picked these ETFs from internet but I think this strategy will work on any correlated basket of stocks. I will try it on commodity ETFs and post my results.

Clone Algorithm
59
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 54923eafe3c061091eeb09f0
There was a runtime error.

@Matt Impressive.

Wikipedia regarding Alpha includes:

At Microsoft we were asked to write bug reports so a five-year old can understand, and keep in mind we're talkin' brilliant developers, lol.

Wonder if anyone has a description of Alpha that a five-year old can understand. Could maybe start with whether higher or lower is better. :) Lower Beta is better for example. Higher Sharpe is sharp. In the Managers Fund those two are valued.

That's a fine looking result Pavy, and what do you think of the Alpha at .17?

In practical terms a strategy with high alpha is a strategy that "beats the market" (meaning it could be up even if the market is down, but also up when the market is up).

The Capital Asset Pricing Model defines the concept of the security characteristic line. This is an important concept in finance.

I assume that you are familiar with the concept of a least-squares regression. The equation you included above is that line. Here is a definition of the meaning of each symbol:

R_{i, t} is the return of an asset i at period t.

R_f is the risk-free rate. This is the return that one could expect on an investment that posed no risk of default.

Since the US government has never defaulted on its obligations, the Treasury rate for a specific maturity (more accurately, the rate of a zero-coupon bond with a specific duration) is sometimes used as a proxy for the risk free rate. However, because of tax incentives, some feel that demand for Treasuries is artificially high and the rates are thus artificially low. Thus, other rates are used. For example, the LIBOR swap curve is used to obtain proxies for the risk-free rate.

\epsilon_{i, t} is a random shock, representing the error. It is a standard element in all regression models, so I won't go into too much detail. The important things to know are that it has an expectation of zero and is specific to both the security and the time.

R_{M, t} is the expected return for the entire market at time t. Clearly, this depends on how you define the market. The S&P 500 is often used, but you could also use a different benchmark depending on the application.

(R_{M, t} - R_f) represents the risk premium to investing in the market. A standard concept in finance is the idea that investors prefer less risk to more risk, and to compensate them for taking higher risk, they must be paid a premium in expected return. This is the value of that premium.

(R_{i, t} - R_f) is the premium for the specific security i. That is what the regression is trying to estimate.

OK, now on to the interesting parts of the equation: the regression coefficients, alpha and beta.

Beta is the correlation between the return of the security in question and the return of the market. An S&P 500 index fund has a beta of 1. A portfolio with half its money invested in cash and half invested in the S&P index fund has a beta of 0.5. A leveraged portfolio that has leverage ratio of 2 and has invested in the S&P index fund has a beta of 2. A portfolio that has sold short the S&P index fund has a beta of -1.

A higher or lower beta is neither good nor bad. It is a selection that should be made based on both how much risk the investor is willing to accept and their opinion on the market. Someone who is bearish may choose a portfolio with beta near 0 or even negative. A bull will choose a portfolio with positive beta. If he is willing to tolerate more risk (in exchange for a higher expected return), he will choose a higher beta portfolio. Since the market is always expected to have a positive return, the bear is missing out on returns by staying on the sideline. If he is smarter than the market, however, this choice may pay off for him.

Alpha is the intercept of the regression. It represents the return of the portfolio that is uncorrelated with the market. Every active investment manager and active investor is looking to deliver positive alpha. Here is the reason why:

Say I have a choice between two mutual funds: a passive fund that mirrors the S&P 500, and an actively managed fund that invests in the S&P 500.

The passive fund will likely have a very low expense ratio, say 0.05%. The active fund will have a higher expense ratio, say 1.00%. Since the passive fund exactly mirrors the S&P 500, it should have a beta of 1.0 and its random shock should be always 0 (since everyone understands how the fund works, its price should track the S&P 500 exactly). However, I am paying the 0.05% fee regardless of how the market performs, so my alpha is -0.05%.

Now lets assume that the actively managed fund also has a beta of 1.0. The beta for individual stocks is calculated by performing a regression on the historical returns of the stock and the historical returns of the market. The beta of a portfolio is the average beta of the stocks in the portfolio, weighted by investment. So from here, it should be clear that it is easy to calculated the beta for a portfolio.

Because the fund has a large number of stocks, the variance of epsilon for the active fund should be very low. This is the benefit of "diversification": because each epsilon is independent and has an expectation of 0, by the law of large numbers/CLT, the sum of these random variables should have an expectation of 0 with low variance.

Now to calculate the alpha of the active portfolio. This is the hardest part, and if it could be reliably done, it would make some hedge funds go extinct overnight and others very busy. Regardless, we know that the alpha is reduced by .01 because of the fee that we pay our manager. We can only hope that the talent of the manager in selecting stocks will increase the alpha as well.

If the alpha is above 0 (say, 5%), we want to invest in this fund. For the same risk level as the passive fund, we expect a higher return. This is the goal of all investing: more return, same risk (or another way, same return, less risk).

In conclusion, alpha is what every investor is looking for. In an efficient market (a major topic itself), alpha should be 0. Alpha is free money, so it both makes sense why people want it and why it's hard to find.