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

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


  • To: =omega list <omega-list@xxxxxxxxxx>
  • Subject: Re:S&C Mag Pairs indicator code - help w/ CoefficientR
  • From: Wayne Mathews <wayne@xxxxxxxxx>
  • Date: Wed, 24 Apr 2002 10:42:47 -0700

PureBytes Links

Trading Reference Links

They use data2 as the x axis instead of using time. That is, the
correlation is between two data streams (data3, data4) instead of
between data1 (y) and time (x).

Just make the changes in the function in coeffR as below:


Inputs: X(numeric) , Y(numeric), Length(Numeric);
Variables: R(0)  {{, X(0), Y(0)}}  , UpEQ(0), LowEQ1(0), LowEQ2(0),
LowEQT(0);

{
X = CurrentBar;
Y = Close;
}

Acually, I would copy coeffR, make a new function and name it coeffRR
(or something) and then make the changes. Also, rename the funcution in
the indicator as coeffRR.


> 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