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

Re: error in TS LinearRegSlope function



PureBytes Links

Trading Reference Links

Do not guess at the value of CurrentBar.  This is the first step in solving
the mystery.  The next step is to always suspect max bars back.  In my six
years with the company this one topic has been the most to resurface.  Next,
the first date of data is almost never equal to CurrentBar 1.  If I am
correct then there are at least four data streams on this chart ( the
symbol, advancing issues, declining issues and unchanged issues ).  This
will complicate the reservation of the max bars back area.  The program must
first find a common bar in all data streams and count n common bars to form
the reserved area.  Then, the very next common bar will be CurrentBar 1.
Judging from where you have identified the problem, I suspect these are the
first few bars after the max bars back area of common bars.

This is only the beginning.  Having said that, I wish success in your
trouble shooting efforts.

Best regards,

Benjamin "ElGuru" Blanco
Certified EasyLanguage Specialist
http://www.blancofamily.net/elguru

----- Original Message -----
From: "Alex Matulich" <alex@xxxxxxxxxxxxxx>
To: "Benjamin "ElGuru" Blanco, Certified EasyLanguage Specialist"
<elguru@xxxxxxxxxxxxxxxx>
Cc: <omega-list@xxxxxxxxxx>
Sent: Wednesday, July 03, 2002 11:38 AM
Subject: Re: error in TS LinearRegSlope function


Benjamin Blanco wrote:
>Variables do not exist in the max bars back area.  MM1 should not be
>calculated until CurrentBar >= 6.  CurrentBar begins its count at one after
>the max bars back area.  Thus, the first time MM1 can correctly be
>calculated is at CurrentBar = 6.  We need four iterations ( Bar 6, 7, 8,
9 )
>of MM1 to correctly calculate MM2 for the first time.  Thus, MM2 should not
>be calculated until CurrentBar >= 9.  For example:
>
>AD = 100*(adv-dec)/(adv+dec+unc);
>if CurrentBar >= 6 then mm1 = LinearRegSlope(AD, 6);
>if CurrentBar >= 9 then mm2 = LinearRegSlope(mm1, 4);

The example from my previous message was around the middle of my data
range, where CurrentBar would be about 200 or so.  My MaxBarsBack is set
to 50 everywhere.  I don't think this is the problem.

>Here's a sample of what TradeStation 2000i calculated:
>
>date          AD        mm1       mm2
>1000627     10.70      4.73      2.78
>1000628     19.55      7.91      3.60
>1000629     -0.57     61.10     18.57
>1000630      0.29     18.32      9.39
>1000703     35.64    -14.95    -11.13
>1000705      1.13    -53.88    -37.82
>1000706      9.92    -90.12    -36.43

In the sample of output above, the first date corresponds to 6/27/2000.
The first date in my data is 9/1/1997.  Plenty of time to let things
settle.

I posted enough data above to calculate the last two values of mm1 and
the last four values of mm2.  mm1 is wrong, mm2 is correct (well, it's
*calculated* correctly, using the wrong values of mm1).

When I get home from work I will try implementing my own LinearRegSlope
function and experimenting with it.

--
  ,|___    Alex Matulich -- alex@xxxxxxxxxxxxxx
 // +__>   Director of Research and Development
 //  \
 // __)    Unicorn Research Corporation -- http://unicorn.us.com