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

[amibroker] ValueWhen



PureBytes Links

Trading Reference Links

I am trying to write code which will count the number of times a 
situation occurred across the price data range.

For example = I know how to count the occurance of a "condition" by 
using 

count = CUM(condition);

I want to find, for only those bars where "condition" was true, how 
many times the close, 5 days later, was lower.

when I try

  testcount = CUM(ValueWhen(C < Ref(condition,-5),C,1));

the result is considerably higher than the number of times the 
condition was true. - not a count of the number of times the "test" 
was true.

Any help would be most appreciated

Rick



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/O10svD/Me7FAA/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/