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

Re: Continuous contract



PureBytes Links

Trading Reference Links

I do everything in Excel with VBA. I'm a low tech trader who uses simple
algorithms to generate my trading signals.

Highest(C,N)
Lowest(C,N)
MA(C,N)

where C = Close and N = arbitrary number of days

The *signals* I derive from these functions are *not* affected by a constant
offset to the input price series. Notice I say signals. The output of the
functions themselves will be different if the input price series is offset
by a constant but the signals I use for trading are all based on relational
operators between price and these functions of price. These relational
operators are invariant to constant offsets.

For example,

C > Highest(C[1],N)
C < Lowest(C[1],N)
C > MA(C,N)

Add or subtract any constant you want to the price series C and the result
of these operations (either TRUE or FALSE) is unchanged.

Here's a ridiculous example:
C = 1,2,3,2,1,4
On day 6:
  C = 4
  Highest(C[1],5) = 3
  C > Highest(C[1],5) = TRUE

Now, subtract a constant 10,000 from each day's price:
C = -9999,-9998,-9997,-9998,-9999,-9996
On day 6:
  C = -9996
  Highest(C[1],5) = -9997
  C > Highest(C[1],5) = TRUE, since -9996 is greater than -9997

Also notice that your change in equity as price moves from 1 to 2 is the
same as when price moves from -9999 to -9998. As I said in my prior email,
your daily equity changes are based on price changes, not absolute price.
However, your margin requirements might be a bit interesting if Corn every
got to -$6.87 :-)

I'll leave it as an exercise to the reader to verify the same result when
adding a positive constant, or when using any of the other functions.

To figure out what type of continuous price series to use for backtesting,
you *must* understand the mathematics of the indicators you are using to
generate your signals.

There will be quiz on Monday.

Scott Hoffman
Issaquah, WA