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

Re:TS2000 LinearRegValue Function



PureBytes Links

Trading Reference Links

> Subject: >          TS2000 LinearRegValue Function
>     Date: >          Thu, 23 Sep 1999 15:44:40 -0400
>    From: >          "Chris Baker" <chrisbak@xxxxxxxxxxxx>
>       To: >          "Omega List" <omega-list@xxxxxxxxxx>
> 
> The last line of this TS 2000 Omega (copyrighted) function is:
> 
> LinearRegValue = Intercept + Slope * (Len - 1 + CurrentBar - CurrentBar -
> TargetB);
> 
> Len is the Length for the Linear Regression and TargetB is the number of
> bars extrapolated forward.     However this calculation struck me as odd
> since CurrentBar - CurrentBar is zero.
> 
> In TS 4 CurrentBar - CurrentBar is:  CurrentBar - BarNumber.
> 
> As I recall CurrentBar and BarNumber can differ in certain circumstances,
> perhaps in a function, however Bar Number isn't even listed in the TS 2000
> Help.   Can anyone recall why it was coded that why in TS 4?


The swinghigh/lowbar code also has this same "CurrentBar - BarNumber" in
the output. CurrentBar - BarNumber under certain circumstances gives
bars ago from the current bar. This is most likely to occur when code
looks back to a previous bar and that bar is identified with its bar
number. This is not the case in either of the two code examples cited
here and I do not know why CurrentBar - BarNumber is include.

Usually in code you will see that currentbar and barnumber are
interchangeable, e.g., "if currentbar=1 then...". A current bar number
can be captured with "CurrentBar" or "BarNumber". A past bar can only be
captured with "Barnumber". Say you want the bar number of the third
swinghighbar back from the current bar. Use MRO to locate it then use
BN=barnumber to capture its bar number.

wayne mathews