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

Re: Please help extend function of condition counter (Was Re: [amibroker] Re: Resetting counter)



PureBytes Links

Trading Reference Links

Hi, try the barssince() function:
  cr  = Cross(C,MA(C,20));
  bs = barssince(cr);


SYNTAX  barssince( ARRAY )  
RETURNS ARRAY  
FUNCTION  Calculates the number of bars (time periods) that have passed since DATA ARRAY was true (or 1)  
EXAMPLE barssince( macd() < 0 )  


UM


----- Original Message ----- 
From: "Owen Davies" <owen5819@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, April 29, 2003 11:54 PM
Subject: Please help extend function of condition counter (Was Re: [amibroker] Re: Resetting counter)


> Can anyone tell me how to count events after a certain condition is met?
> Say, number of times a stochastic (or whatever) has crossed its moving
> average (or whatever) since Cross(C,MA(C,20)) (or whatever?)
> 
> Actually, while I'd like the most general solution possible, at the moment
> I'm trying to count events after a Buy, Sell, Short, or Cover.  And, of
> course, it has to be reset for the next trade.
> 
> (I swear, fifteen years ago I could have figured this out for myself.  I
> really gotta get back into programming!)
> 
> Many thanks.
> 
> Owen Davies



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading!
Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/cjB9SD/od7FAA/AG3JAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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