SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
deskquant
Topic Author
Posts: 48
Joined: October 24th, 2010, 2:54 am

Pairs trading in futures.

June 11th, 2013, 8:44 am

Hi, this may be a classical or a rather simple problem. I am looking to build a pairs trade using futures contracts that have monthly expiries. An obvious question is how to deal with expiration aside from the fact that I need to roll any expiring positions.My question is basically around setting up the backtest and an efficient execution. One idea could be to make sure that my out of sample period never straddles my expiration point. In other words, since I need to liquidate my positions at the end of out of sample period and also at the end of expiration, I can take care of both of these by building a strategy from expiry to expiry. I am not sure if I was clear, but please let me know if I wasn't and if yes, please offer any advice or suggestions.
 
User avatar
Martinghoul
Posts: 3256
Joined: July 18th, 2006, 5:49 am

Pairs trading in futures.

June 11th, 2013, 6:27 pm

Why don't you "stitch" together a time series of continuous futures prices? Once you've done that, there should be no issues such as you describe...
 
User avatar
deskquant
Topic Author
Posts: 48
Joined: October 24th, 2010, 2:54 am

Pairs trading in futures.

June 12th, 2013, 1:30 am

Thanks for the note. I already do that, I guess I wasn't clear. Basically here is what I have in my mind, and please let me know if I sound totally off.Say you have 1000 points of continuous data, Say my insample is from 1 to 200 points, and out sample is from 201 to 300 points and so on. Obviously at the end of the first out sample period, my strategy changes depending on my model specifications. And I will liquidate any open positions to reflect the change in my model. Now I also have to liquidate any open positions when the contract expires. I was looking to do this at the same point in time. In other words I want my out sample end to coincide with my futures expiry time. Does that make more sense?
 
User avatar
GuitarTrader
Posts: 78
Joined: July 13th, 2011, 1:01 pm

Pairs trading in futures.

June 12th, 2013, 6:07 am

hi, how to stitch together a time series of continuous futures prices?any common method
 
User avatar
Martinghoul
Posts: 3256
Joined: July 18th, 2006, 5:49 am

Pairs trading in futures.

June 12th, 2013, 7:06 am

QuoteOriginally posted by: GuitarTraderhi, how to stitch together a time series of continuous futures prices?any common methodI think there's a well-known paper floating arnd on the web somewhere that talks about a few common methods for doing this... I think it's this one: Futures, but there are others.QuoteOriginally posted by: deskquantThanks for the note. I already do that, I guess I wasn't clear. Basically here is what I have in my mind, and please let me know if I sound totally off.Say you have 1000 points of continuous data, Say my insample is from 1 to 200 points, and out sample is from 201 to 300 points and so on. Obviously at the end of the first out sample period, my strategy changes depending on my model specifications. And I will liquidate any open positions to reflect the change in my model. Now I also have to liquidate any open positions when the contract expires. I was looking to do this at the same point in time. In other words I want my out sample end to coincide with my futures expiry time. Does that make more sense?No, sorry, it doesn't, but that could be because I am being slow... Given you have a continuous futures series and assuming you believe in the "continuity", why do you have to liquidate at expiry? Why not roll? I also don't understand the point you're making about the model changing at the end of the sample period...
 
User avatar
deskquant
Topic Author
Posts: 48
Joined: October 24th, 2010, 2:54 am

Pairs trading in futures.

June 12th, 2013, 7:11 am

Thanks again for the note. About the model change, I have sets of overlapping insample training and out of sample trading periods. I have divided my data into many such periods. I refit or re train my model at the end of every out of sample period, hence the model changes? Is that not commonly done? You can think of it as a rolling model fitting procedure.With regards to the roll, yes I need to roll but the market I am in does not have calendars so rolling is actually selling the expiring contract and buying the new front month. The whole point is that I want to make sure that my rolling point coincides with my out of sample end point, so that I pay the cost ( of rolling ) only once. Once my out of sample expires, I essentially need to liquidate my portfolio because the behavior ( the model parameters ) has changed. If this coincides with expiry, then I can basically start afresh at the next insample fitting period - outsample trading period. Does that make more sense now?
Last edited by deskquant on June 11th, 2013, 10:00 pm, edited 1 time in total.
 
User avatar
tagoma
Posts: 18363
Joined: February 21st, 2010, 12:58 pm

Pairs trading in futures.

June 12th, 2013, 6:09 pm

Quotehi, how to stick together a time series of continuous futures prices?I would say this is an art more than a science. Besides Marthinghoul's suggestion, one can also find some hints in 8.1.4.2 Rolling nearby futures contracts (RiskMetrics), and in Carol Alexander's Market Risk Analysis (I don't remember which volume).(Message in a bottle) I am curious to read papers or anything else about pair trading of ags futures.
Last edited by tagoma on June 11th, 2013, 10:00 pm, edited 1 time in total.
 
User avatar
chocolatemoney
Posts: 322
Joined: October 8th, 2008, 6:50 am

Pairs trading in futures.

July 22nd, 2013, 3:08 pm

My 2 cents, I haven't been dealing with this prob for a while, but if I remember correctly:CSI's UA user guide gave me some good hints on what can be done (frwd vs backwards adjustments, roll triggers, etc).It may be worth a look: http://www.csidata.com/custserv/onlineh ... Manual.pdf
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On