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

[amibroker] Average: barssince, cum(1), sum ??



PureBytes Links

Trading Reference Links



Hi everyone,
 
I’m new to AB and am having trouble determining the code concepts of the AFL language.  What I’m trying to code is a simple math function, but no matter how many different variables I use, I can’t get it J. I have tried using functions of barssince, cum(1), sum, = =, y !=, ++y, but I can’t put any of it together to obtain my value.
 
I’m trying to obtain the average value for my code:
 
PPO = (EMA(C,20)-EMA(C,50)) / EMA(C,50);
 
What I want to do is; 
 
sum value, over my time frame -- x =250 days,  that PPO was above .15 then divide the sum value by the total # of count days (bars),over my time frame -- x =250 days, that PPO was above .15. Hence my average.
 
Is there anyone that can help me?
 
DonnaPost your free ad now! Yahoo! Canada Personals






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.