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

Re: Bar Counter



PureBytes Links

Trading Reference Links

At 4:47 PM -0400 10/8/98, Cab Vinton wrote:
>I'm having trouble finding a way to reference the absolute number of
>bars loaded in the Chart Function of TS.
>
>(Forget for the moment that at least according to the Data Window the
>first bar is always skipped: try a 3 day average for the close for
>example & you'll see that the program doesn't start plotting until the
>_fourth_ bar.)
>
>I created a function (BarN) that simply increments by one with each bar.
>I was hoping that I would then be able to call that function from
>another function.
>
>Unfortunately, this doesn't work. The MaxBarsBack of the calling
>function is apparently interfering with when BarN starts its
>calculations.
>
>Anyone have any ideas on how to get around this?


The BarNumber function returns the value of each bar after the MaxBarsBack
period.

For example, create an indicator called BarNumber. Make it equal to the
BarNumber function. Set the MaxBarsBack = 3 (User specified). The BarNumber
indicator will start plotting on the fourth bar with a value of zero.

So the absolute value of a bar should be:

    Index = BarNumber + MaxBarsBack;

Bob Fulks