Here is a quick idea I had the other day. I was reading about statistical arbitrage and pair trading and as some of you may know, the notion of spread is quite central in the domain. The idea behind pair trading is somewhat simple; find assets exhibiting similar behavior, then when the spread depart from the mean bet on the subsequent return to normal. Simple, elegant and based on sheer intuition, everything I like in a trading concept.

I looked at ways to incorporate the concept in a simple system. This strategy looks at the normalized spread (difference) between the closing price and a short-term moving average (for this example 3 days). In other words, I use the percentrank function on the difference between the last closing price and the 3 day moving average of a single asset. Enter long if < 50th percentile, short otherwise. The results on SPY since 2000 are presented below.

Conceptually this makes a lot of sense. If the recent price exhibit strong relative strength we expect it to return to normal, the opposite holds true for weak relative strength. Normalizing the spread give use an indication of the degree to which the recent price departs from the past couple days and from there we can expect a given degree of reversion to the mean. If the price becomes “stretched” I would be more confident than if the price was range bound around the mean. That being said, this idea has nothing genius about it; it is yet another relative strength strategy and is very similar to the well known z-score. However, I like that by using the percentile we do not have to assume any distribution thus relaxing the need for normality in the data. It also facilitates the creation of a confidence based bet scheme or a “dimmer approach” à la MarketSci. Regardless, I think that the concept of spread is a good concept, expect it to come back on the blog as I learn more about it.

QF

### Like this:

Like Loading...

*Related*

Would it be possible to see the excel sheet for this?

I sent it to your email address.

Cheers,

QF

For PercentRank function what is the length of time you used? Also, is it possible for you to share the calculation?

Hello Anand,

I am sorry I forgot to mention; the lookback period for the percentrank function is 252 days. By share the calculation do you mean a spreadsheet ?

Cheers,

QF

Hi QF,

If you could share the spreadsheet that would be great. I want to compare my calculation with yours. It seems, I have a bug in the spreadsheet i built.

Best,

Anand

Done.

Cheers,

QF

Thanks QF for sharing the worksheet. In the worksheet you go long when Percentile score is less than .5 right? I got confused with your “long if > 50th percentile” statement. One interesting observation i found when i went back upto 1993 is, this strategy started working from the 2000. Before that it was pretty much working the wrong way. Is that because after 2000 the MR type of strategies started working? Maybe, an adaptive type of trading strategy is required here like the following: http://marketsci.wordpress.com/2008/09/24/how-to-build-an-adaptive-trading-strategy-part-ii-an-example/

Thank you for pointing out my typo ! And yes, since this strategy is MR based and without any adaptive mechanism built-in it doesn’t work well before the MR paradigm shift. The idea for the post was to propose a different (yet another) MR indicator for the reader to explore. There is several modifications possible to improve the system as it is very basic as explained now.

Thank you for the comments,

QF

I too would like to get a copy of your spreadsheet. Thanks.

Hi,

Looks like some nice results. Would you consider this a practical strategy? How many total trades did you observe for the spread strategy? Also, for the buy and hold strategy, I assume you buy at the start of the evaluation period and hold until the end; so I’m wondering what is the meaning of winning percentage of 52.93% relates to for only one trade?

Hello Brent,

I would not trade the strategy as is, however I think the concept has some merit and deserve further research. Concerning the winning %; I use the following formula: number positive return days / total days.

Cheers,

QF

Also, would you mind sending me a copy of your spreadsheet?

Done.

Cheers,

QF

QF-Have you considered making this a conditional criteria for entry into the “adaptive time machine” strategy for CSS Analytics? I’ll curious if that combined they would positively affect trading performance or not. Also could you send the spreadsheet for the normalized strategy?

~Freeman

Freeman,

I sent you the spreadsheet, and considering your question, I am not quite sure I understand how both strategies could be used together since the time-machine is essentially a run analysis strategy and this one being a MR indicator. Could you elaborate some more on your idea please ?

Cheers,

QF

An important issue with respect to spread trading is the amplitude of (hopefully temporary) down draws. It is somewhat of a catch-22. Given pairs that you can show are historically correlated in some way, the spread arises once the correlation temporarily diverges. As the divergence (normalized spread in this case) increases, one should have even more conviction in the trade. However, given that you are betting the opposite way there is no guarantee that one can remain solvent waiting for the reversion – or in fact that the correlation remains valid at all.

Clearly the importance of this issue varies by asset class. It deserves much more consideration for futures and structured products than it does for equities. But it can be important nonetheless.

To put it in a more concise and well-known way: “The market can behave irrationally much longer than you can stay solvent.”

Thank you for the well thought comment Pinner,

I agree with everything. I think that the state of short-term MR (market regime) is crucial when making a decision as to trading a system like this.

Cheers,

QF

What securities are you trading in this system?

Hello MP,

I will have to clarify the post, as it seems to confuse many readers. The spread is within the asset time-series itself, it is not a pair strategy. The symbol traded is SPY.

Cheers,

QF

Nice!

Would appreciate if you could send the file to me also.

Will share my work with you if i find something useful.

Thanks.

I just wanted to make clear how much impact would have broker fees on such frequent strategy…it’s not a bad comment since I consider the bottom line idea very interesting, but simply to put it into real perspective.

http://www.4shared.com/photo/ChqsENWY/Price_Spread_Strategy.html

Hello Paolo,

Thank you for the comment, I agree with you that every strategy trading frequently is subject to big influence from transaction costs. I apologize if I didn’t made that clearer in the post.

Cheers,

QF

QF,

Great work on this analysis. Could you please share the spreadsheet with me. I would like to compare my results with your analysis. THANKS!

Sent.

Cheers,

QF

Nice work. I would also like to see the spreadsheet to compare results. Thanks QF!

Hello QF,

do you think i can have a look at the spreadsheet?

thanks in advance

I just sent it.

Cheers,

QF

Please, can i have a look at spreadsheet?

hanks

Hello QF, it will be a great favor if you can share the spreadsheet for the normalized price spread strategy

Hey Nik,

It should be in your inbox by now.

Cheers,

QF

Can I get your spreedsheet??

I still confuse with this concept.. when to buy/sell and which pair…

thanks.

Done.

QF

Hi Nik

I’d also like a copy of that spreadsheet if its still available.

Many thanks

I just sent it. Sorry for the delay.

Cheers,

QF

If still available, could I get a copy of your spreadsheet? Thanks.

Hi could you send me the excel file please ? I am curious about pair trading. thanks

Hey QF, would be extremely kind of you of I could get a copy of the excel spreadsheet…..would be grateful for it…

Thanks ,

Clive .

my email id is clive_me@yahoo.com.

Sent.

QF

Hello QF,

Your site has been a godsend in my trading curiosities. I’ve been trying to implement this in a worksheet and I was wondering you could please send me your spreedsheet? Thank you

I am a bit confused. If

close – (3-day MA) < percentrank(50)

this implies the close is significantly larger than the average. Mean reversion would then dictate that you go short, but you are saying to go long in this scenario.

Perhaps I am misreading you. I am noticing that the strategy makes a killing during the 08/09 crash months. This is a bit counterintuitive because stocks were not at all range bound then. Of course, using just a 3-day MA probably renders my intuitions false. I'd love to see the spreadsheet!

Please send me the excel sheet…

Hi QF

May I have a copy of your spreadsheet if its still available.

Many thanks