BarsSince produces an array of values i.e. the number of bars since
whatever condition from the perspective of each individual bar. If
the
perspective you want is only from the last bar then this can
always be
gotten at via LastValue ...
CurrBars =
LastValue(BarsSince(MyCondition));
--- In [EMAIL PROTECTED]ps.com,
"Chris DePuy" <[EMAIL PROTECTED]> wrote:
>
> Terry, thanks for
the reply, but I must be missing something you
said because i cannot see
how your suggestion changes the BarsSince
instruction from returning the
number of bars since the selected
value to returning the value the last
value in an array.
>
> The problem i'm having is I'm asking "how
do i get a count of how
many bars have passed since a condition has
occurred RELATIVE TO THE
LAST BAR even though I have not selected the last
bar?"
>
> I want this value to change during the day in
real-time, so that
with each successive 15 minute bar that occurs, the
value would
increment by one (bar) unless there's another change in the
array
being processed. Right now, using BarsSince, i can only accomplish
this by using the mouse and clicking/selecting on the right-most bar
in the indicator window.
>
>
> ----- Original Message
-----
> From: Terry
> To: [EMAIL PROTECTED]ps.com
> Sent: Friday, October 06, 2006 12:09 PM
> Subject: RE:
[amibroker] barssince question
>
>
>
> You are
computing an array, which is what usually happens so
just use.
>
> LastValue(Array);
>
> --
>
>
Terry
>
> -----Original Message-----
> From: [EMAIL PROTECTED]ps.com
[mailto:[EMAIL PROTECTED]ps.com]
On Behalf Of Chris DePuy
> Sent: Friday, October 06, 2006 12:28
>
To: [EMAIL PROTECTED]ps.com
>
Subject: [amibroker] barssince question
>
>
>
> I
am trying to display in an interpretation how many bars have
passed since
the close crossed a moving average, but I want to use
the reference point
of the last bar at all times. Using BarsSince,
its calculating the bars
since the SelectedValue (see my below
snippet). Can anyone tell me how to
get this to reference bars
since last cross relative to the last
bar?
>
> "bars since c> wma long (blue) =
"+BarsSince(Cross(C,WMA
(C,period)));
>