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

[amibroker] Average: Barssince, Sum, Barcount, Cum(1)??



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 a simple math function, 
but no matter how many different variables I use, I can't get it :-)! 
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 PPO value, over my time frame -- x =250 days,  that PPO was 
above .15 then divide the sum PPO 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?

Donna




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/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/