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], "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] 
>   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] 
[mailto:[EMAIL PROTECTED] On Behalf Of Chris DePuy
>   Sent: Friday, October 06, 2006 12:28
>   To: [email protected]
>   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)));
>






Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to