Steve Hansen of Raymond James Ltd. in Vancouver, B.C. suggested to me that a good trading signal for the GLD - GDX spread is when it exceeds 2 standard deviations from its mean. He observed that these are roughly at +/- $250 based on my definition of the spread, and that there were 3 such (immensely profitable) signals since the inception of GDX. Here is Mr. Hansen's plot:

This certainly looks like a fairly safe strategy. Of course, if one desires more frequent signals, one can always enter into smaller positions at smaller spread values.

By the way, just when we were celebrating the reversion of the GLD - GDX spread this morning, the QM - XLE spread plunged to another multi-year low. With crude oil prices down about 30% from its all-time-high, XLE, the energy stocks ETF, is still within 5% of its all-time high. Does this make any sense? We shall see after this quarter's earnings from the oil companies are announced ...

## Friday, November 17, 2006

Subscribe to:
Post Comments (Atom)

## 12 comments:

EC-

What do you think about the historical SPY ETF and S&P e-mini futures spread? If its not too much trouble do their st. deviation analysis like you did for GLD-GDX. thanks a lot!

Yaser: What you suggested is similar to the classic "index arbitrage" between SP500 stocks and stock index futures. Since the index arb desks of investment banks have been doing this for many years, the spread is likely to be very narrow and typically no longer profitable in recent years. Maybe you heard otherwise? Of course, one can also consider trading the spread between a basket of SP500 stocks and SPY ETF also. But I think the portfolio manager of SPY must have taken care to remove most arbitrage opportunities for us.(However, I like your earlier suggestion of using OIH instead of XLE. I will post an analysis of that next week.) -Ernie

I should add that the standard deviation of GOLD-GDM is $207, not $125 based on the short history of GLD-GDX. So following Mr. Hansen's suggestion of 2xstddev, the entry point would be $414.

Sir,

I am newbie to algo trading.Currently I try to follow your book,now I have some questions.

According to example 3.6

% ensure existing positions are carried forward

unless there is an exit signal positions=

fillMissingData(positions);

I am not really understand how to carry forward those positions and also I can't find the fillMissingData function in spatial-econometrics.com

Thank you very much for your suggestion.

Art

Hi Art,

The fillMissingData function is available for download from epchan.com/book. See last paragraph of page 34 of my book for password.

It simply copies the previous bar's value (price? position? whatever?) to the current bar *if* the current bar's value is NaN.

Ernie

Hi Ernie,

I've been trying to use the backtesting code for cointegrating pairs, and have been using it in conjunction with scraping data from yahoo, for some pairs that I backtest on (most) the sharpetrainset comes up as NaN. any idea whats going on?

Cheers

Hi Anon,

Mostly likely you have included non-numeric data in your input.

Ernie

Hi Ernie,

When I took the GDX.xls and GLD.xls files from http://epchan.com/book/ I got same error as anonymous. However, when I took the files straight from Yahoo Finance I got no NaN result. But I got 3.0 and 5.6 for test and training sharpe ratios respectively, results which did not match what you suggested in your matlab code for example 3.6

Cheers,

Manuel

Hi Lu,

Did you use the same periods for training and testing using Yahoo data?

Your Sharpe ratios sound too good to be true.

When you load my .xls files into Matlab, make sure your price arrays do not have NaN.

Ernie

Dear Arnie,

in the book quantitative trading you calculate the sharp ration for the spread ( for the training set )as

sqrt(252)*mean(pnl(trainset(2:end))).

/std(pnl(trainset(2:end)))

I am not using matlab ( as I dont have the software), how can I use the Sharp ratio for the spread which in excel is in the form of ln(x)-0.78765*ln(y) where x and y are the future prices of the two scripts.

Hi JPS,

You can easily compute the average and standard deviation of daily returns in Excel. Taking their ratio and multiplying by sqrt(252) gives you the annualized Sharpe ratio, assuming 0 risk free rate.

Ernie

Hi JPS,

You can easily compute the average and standard deviation of daily returns in Excel. Taking their ratio and multiplying by sqrt(252) gives you the annualized Sharpe ratio, assuming 0 risk free rate.

Ernie

Post a Comment