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

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



PureBytes Links

Trading Reference Links




You use the Cum function I 
think would be easiest
 
PPOover = 
PPO>0.15;  
PPOcount = 
cum(PPOover);  
PPOtotal = 
cum(PPO>0.15);  
PPOavg = PPOtotal / 
PPOcount ;  
 
Hoping I have understood 
your requirements.
 
Cheers,Graham<A 
href="">http://groups.msn.com/asxsharetrading<A 
href="">http://groups.msn.com/fmsaustralia 


  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: donna girardin 
  [mailto:dmarval@xxxxxxxx] Sent: Saturday, 6 December 2003 6:53 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] 
  Average: barssince, cum(1), sum ??
  
  <FONT face="Times New Roman" 
  size=3>Hi everyone,
  <FONT 
  face="Times New Roman" size=3> 
  <FONT 
  face="Times New Roman">I&#8217;m new to AB and am having trouble determining the 
  code concepts of the AFL language. <SPAN 
  > What I&#8217;m trying to code is a simple 
  math function, but no matter how many different variables I use, I can&#8217;t get 
  it <SPAN 
  ><SPAN 
  >J<FONT 
  face="Times New Roman">. I have tried using functions of barssince, cum(1), 
  sum, = =, <SPAN 
  >y !=, ++y, 
  but I can&#8217;t put any of it together 
  to obtain my value.
  <FONT 
  face="Times New Roman" size=3> 
  <FONT face="Times New Roman" 
  size=3>I&#8217;m trying to obtain the average value for my code:
  <FONT 
  face="Times New Roman" size=3> 
  <SPAN 
  >PPO = 
  (<SPAN 
  >EMA<SPAN 
  >(C,<SPAN 
  >20<SPAN 
  >)-<SPAN 
  >EMA<SPAN 
  >(C,<SPAN 
  >50<SPAN 
  >)) / 
  <SPAN 
  >EMA<SPAN 
  >(C,<SPAN 
  >50<SPAN 
  >);
  <SPAN 
  > 
  <FONT face="Times New Roman" 
  size=3>What I want to do is; 
  <FONT 
  face="Times New Roman" size=3> 
  <FONT face="Times New Roman" 
  size=3>sum value, over my time frame -- x =250 days, <SPAN 
  > 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.
  <FONT 
  face="Times New Roman" size=3> 
  <FONT face="Times New Roman" 
  size=3>Is there anyone that can help me?
  <FONT 
  face="Times New Roman" size=3> 
  <FONT face="Times New Roman" 
  size=3>Donna
  
  
  Post your free ad now! Yahoo! 
  Canada PersonalsSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







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.