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

Re: [amibroker] Function Wish List



PureBytes Links

Trading Reference Links


Hi,
 
To count the number of occurences of someevent 
during n last bars use Sum() function:
 
signal = close > Ref( close, -1 );
 
howmanytimes50 = sum( signal, 50 );
 
To count total number of bars (since the first bar 
loaded) use Cum() function:
 
howmanytimestotal = cum( signal );
 
 
Best regards,Tomasz Janeczko===============AmiBroker - the 
comprehensive share manager.<A 
href="">http://www.amibroker.com
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
<A title=fesnay@xxxx 
href="">fesnay@xxxx 
To: <A title=amibroker@xxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Saturday, June 09, 2001 11:35 
PM
Subject: [amibroker] Function Wish 
List
Tj,In a ranking system that I am building, I have a 
need to count the number of times something happens within the past "X" 
number of days.  For example, suppose I want to count the numberof 
times in the most recent 50 days that the close was higher than the 
previous days'.  The only way I can accomplish this in the current 
AFL is via multiple iif() statements, one for each day.  Not 
difficult if only a couple of days of testing is needed, but cumbersome 
for a year of data!Any suggestions?  Possible example:A count 
function, ie, count(condition, # of days back from end of data)or 
count(condition, starting # back, ending # back) with ending # back 
defaulting to end of current data unless specified elsewise.Thanks, 
FrankYour 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.