[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Continuous vs Perpetual - which one is the best! - Part 1



PureBytes Links

Trading Reference Links

This topic comes up from time to time. Discussions always seem to generate
a lot of strong opinions. When I started looking at futures a while back, I
searched for a simple summary but was not able to find one so I have been
collecting information over time.

It is a fairly complicated issue so I decided to summarize all the factors
that I am aware of in a long post. This will be "more than you ever wanted
to know about back adjusting futures prices". If this is of no interest to
you, please delete this message now.

I would welcome other opinions so that I can improve this summary over
time. This message already incorporates text from posts by several other
people, especially Bob Brickey, mostly posted on the TradeLab list during a
discussion of this topic of July 1998.

I tried to post this earlier but it seems to exceed the size barrier of the
list so I will post it in two parts.

------------------------------

I. Introduction

To backtest a trading system for trading futures contracts, we would like
to have a long duration of price data on which to test our trading system.
The problem is that futures contracts expire periodically and the data for
each contract lasts only a few weeks or months. So we need some way to
create a long series of price data from a sequence of contract prices. This
post will discuss the various ways it can be done and explore the
advantages and disadvantages of each method. My experience is with only the
S&P futures contract so I will use it as an example although the same
principles apply to any future contract.

II. The Problem

The issue arises because the pricing of a futures contract is slightly
different than the price of the underlying commodity since it includes
other factors. This difference is called the "premium". For the S&P Futures
this difference includes the cost of interest and the dividends of the S&P
stocks.

The theoretical value is called the "fair value". It is the price at which
investing in the underlying commodity has the same return as investing in
the futures contract. For agricultural futures, the difference can include
such things as storage costs, etc. For the S&P futures it is calculated as
follows:


      Futures_Price = Cash_Price * (1 + d * (i - v) / 365)

where:

    i = interest rate for fair value calculation = about 5% now
    v = dividend rate of the S&P cash index = about 1% now
    d = days_to_expiration

At rollover, the days_to_expiration number jumps, causing the jump in the
premium. With today's values, the jump in price is about 1%, or about 12
points on the S&P futures contract. In the examples that follow, for
simplicity, we will use the 12 points as the size of the jump at
expiration, keeping in mind that the actual number does depend upon the
level of the index, and interest and dividend rates.

The interest rate term arises because with the futures contract, we are
using leverage for which we are not paying interest. Thus, the cost of the
interest gets built into the price of the futures contract.

The dividend term arises because with futures, we do not get the dividends
that we would have gotten if we had bought all the stocks in the S&P. (This
is approximated as an average but since dividends occur at different times,
an accurate simulation would include the exact expected dividends and when
they were paid.)

The actual price difference between the futures contract and the underlying
can and does deviate from this theoretical value on a minute by minute
basis. But the difference is usually very short lived because arbitrage
players step in to buy one and sell the other and this activity keeps the
relative prices closely tracking fair value. There are often fairly big
differences in the reported daily "closing prices" since the futures
markets close at a different time than the cash market and a lot can happen
between the close of the two markets.

Thus, we have a discontinuity in the price of the futures contract at the
expiration that must be accounted for in some way for backtesting.


III. Possible Methods

The primary alternatives are:


1. Splice contracts together without price adjustment.

This causes large price jumps at splice points. The price jumps cause two
problems.

    a. They distort the operation of most trading indicators and automatic
trading systems. For example a 14-day simple moving average would mix some
of the prices from the old contract and the higher prices from the new
contract giving a distorted picture of what is happening.

    b. They can cause large trading profits and losses to be included in
backtest results that a trader would not have experienced in actual
trading. For example, if our system was long one contract before the
expiration and we sold after expiration, then the system would include the
12 point artificial jump in price for an apparent profit of 12 * 250 =
$3000. If we didn't notice this, we might think our trading system was very
profitable. Even worse, if we were optimizing the parameters of our trading
system, some of the parameter values might cause us to hold the position
through the transition and some might not, causing big discontinuities in
the results and causing us to get false optimum parameter values.

As a result of these problems, this method is unsuitable for most backtesting.


2. Close out trades at "roll over" to the new contract at expiration.

This is what we have to do in real life at the end of a contract. To do
this, we exit the old position and re-enter a new position in the new
contract. But this is trickier than it appears in backtesting since we
would have to make sure that any indicators or averages we are using do not
simultaneously look at some old and some new price values.

Some people prevent this by using "bridge data". For example, if your
trading system uses 14 days of past data as part of its calculations, you
would need to artificially create 14 days of bridge data from the old
contract, increased in price by the 12 points, to get the trading system
initialized at the new contract values. This can be difficult to do if we
are trying to test over a long price series including several contracts.


3. Splice contracts together with forward price adjustment at contract
   boundaries.

Subtracting the 12 point difference from each new futures price before we
use it does this. On the following contract, the offset would be 24 points,
etc. This method eliminates the need to manipulate old price data but
causes the futures contract prices to keep diverging further and further
from actual prices as time goes on.


4. Splice contracts together with backward price adjustment at contract
   boundaries.

This is the method most often employed. Adjusting the price of the old
contracts by adding the offset (12 points in our example) accomplishes
this. With this method the most recent continuous futures contract prices
are same as the current contract prices, but previous contract prices are
offset. Backward adjustment is much more difficult to do, because all past
prices have to be recalculated at each new contract boundary.

Some people add the difference to past contracts and some multiply all old
data by a factor, 1.01 in our example. Adding the offset is most common
since it keeps the old price values lined up with the tick values. For
example, if a contract moved in 1/32 point increments, we would like the
increments to remain on 1/32 boundaries far back in time. Using the
multiplying factor would slowly cause them to deviate.

Either of the method 3 or 4 above gives us a series of prices with no
discontinuities. They maintain the bar-to-bar increments as they were in
the original contracts. Since most trading systems use the bar-to-bar
differences these methods will not distort the trades. You can test if your
trading system is sensitive to the absolute level of prices by adding some
constant, such as 100 points, to all prices. If the trades and profits
remain the same, your system is independent of the absolute level of prices
and will not be affected by the back adjustment process.

On some commodities, the back adjustment is negative and this can make the
price go negative over time. This is easy to handle by simply adding a
constant value to all prices when backtesting to assure that all prices
remain positive.

----

End of part 1. Continued in the next post.