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

Re: S&C Mag Pairs indicator code - help w/ CoefficientR



PureBytes Links

Trading Reference Links

At 8:48 PM -0700 4/23/02, sunfiles wrote:

>I have the code for CoeffR in TS2K but I think the code named "CoefficientR"
>as used in the formula from S&C May issue on Pairs Spread trading must be a
>derivative of CoeffR.  There are too many inputs in their formula to use
>CoeffR.
>
>Below is the indicator for Pair trading taken directly from S&C Magazine.
>Please review and tell me what you think they are using for CoefficientR
>code.  THANKS!

I modified the Omega CoeffR code (actually the CoeffR_a code) to
accept two price series (as your code seems to require) and called
the revised version "CoeffR.S".

I then wrote an indicator to compare the result with the rpbPearson
code provide several years ago by Bob Brickey (of TradeLab fame). The
results were almost identical. The Brickey code is much more
numerically stable so should be more accurate. (The Omega code
subtracts nearly equal very large numbers so is much more susceptible
to errors.)

The indicator and the two functions are attached as an ELA file.

Bob Fulks

Attachment: Description: "CORRTEST.ELA"

Attachment: Description: "%CORRTEST.ELA"