[R-SIG-Finance] Continuous time series in futures.
Andrew Piskorski
atp at piskorski.com
Sun Jun 16 23:07:51 CEST 2013
On Sat, Jun 15, 2013 at 08:12:22AM -0500, ganesha0701 wrote:
> Hi I did go through the previous posts on this topic but still confused. I
> am basically researching on some ideas and need continuous time futures
> data. At any point in time I basically have three futures, F1, F2 F3. They
> basically have monthly, 2 month and 3 month expiries. I have daily OHLC
> data for all of the, but need to create continuous time series.
>
> I am basically researching on convergence-divergence ideas in price space.
> What is wrong with just the following procedure
>
> 1) Just grab the F1 price and at the roll data switch to F2 or the new
> front month?
What "roll date"? You have to pick your roll dates. In many markets
there are common conventions when everyone rolls, thus all the traders
will know when the roll date is coming up, it's not secret. But, I
have never seen that knowledge encoded anywhere, and certainly not in
computer readable form. You typically have to figure it out on your own.
For backtesting strategies that are intended to be continually
invested in whatever the single "live" or "primary" futures contract
is at any given time, I've used a shortest path algorithm to
retrospectively pick the roll path through the highest volume contract
on each day. (Some markets trade similar volume in a wide range of
contracts, others mostly only trade one contract at a time. Here I
only wanted to trade one contract at a time.)
That should give you reasonable choices for rolls dates, and is a big
convenience vs. having to manually decide what all those ancient roll
dates should have been. Of course that only works after the fact
looking backwards, but as long as your strategy isn't trying to profit
from the roll yield it probably won't introduce cheating into your
backtest.
But that probably isn't useful if your strategy is primarily
interested in the price spreads between contracts expiring at
different times (the term structure of one futures market).
> When I went through the papers and discussion on creating continuous
> contract, please correct me if I am wrong but it seemed that the procedure
> is the follows, to get the front month contract.
There are multiple ways to do it. The usual approach is to "link
prices" using either an additive or multiplicative price adjustment.
The adjustment is simply to remove the price jump due to switching
from the old to the new contract. And of course you can either adjust
all the old prices to match the current true market price, or the
current prices to match some point in the past, whichever is
operationally more convenient for you.
Morningstar gives a clear and detailed description of the particular
linking procedure they adopted for their commodity indexes, which
seems like as good a place to start as any:
http://corporate.morningstar.com/US/documents/Indexes/ConstructionRulesCommodityIndex.pdf
"Construction Rules for Morningstar Commodity Indexes"
Morningstar Methodology Paper Version 3.2, May 31, 2008
Instead of linking that way, you could also create a synthetic
"perpetual" contract which is always a constant distance from
expiration. Various textbooks talk about that stuff. Since you are
interested in the term structure, that may be more what you want.
Or you may be interested solely in the spread between adjacent
contracts, and model that directly. Some spreads are even traded for
real with their own contracts, so you may want to get direct price
data on those.
They key thing is to think about which information your price linking
process retains and which it discards. E.g., is the roll yield
included, or assumed to be zero? You need to pick a linking process
that's appropriate for modeling your particular strategy, calculate
returns correctly, etc.
--
Andrew Piskorski <atp at piskorski.com>
More information about the R-SIG-Finance
mailing list