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

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



PureBytes Links

Trading Reference Links




<SPAN 
><FONT 
size=2> 
PPO = (<FONT 
color=#0000ff>EMA<FONT 
face=Verdana>(C<FONT 
color=#0000ff>,<FONT 
size=2>20)-<FONT 
size=2>EMA(<FONT 
size=2>C<FONT 
size=2>,50)) / 
EMA<FONT 
size=2>(C<FONT 
color=#0000ff>,50<FONT 
size=2>);
A1=<FONT 
size=2>Sum<FONT 
size=2>(PPO>0.0<FONT 
size=2>15<FONT 
size=2>,250<FONT 
size=2>)/250<FONT 
face=Verdana color=#0000ff>;
 
// OR
A2<FONT 
size=2>=MA<FONT 
size=2>(PPO>0.0<FONT 
size=2>15,<FONT 
size=2>250<FONT face=Verdana 
color=#0000ff>);
 
<FONT 
face=Verdana>Plot(A1,<FONT 
size=2>"Sum method",<FONT 
size=2>2<FONT 
size=2>,1<FONT 
face=Verdana>);
// 
OR
Plot<FONT 
face=Verdana size=2>(A2,"MA method"<FONT 
face=Verdana size=2>,1<FONT face=Verdana 
size=2>,1<FONT face=Verdana 
size=2>);
 
It will take at least 250+ bars to show a 
result.
 
-Corey Saxe
 
 

----- 
Original Message ----- 
<BLOCKQUOTE 
>
  <DIV 
  >From: 
  donna girardin 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, December 06, 2003 2:53 
  AM
  Subject: [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’m new to AB and am having trouble determining the 
  code concepts of the AFL language. <SPAN 
  > 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 <SPAN 
  ><SPAN 
  >J<FONT 
  face="Times New Roman">. I have tried using functions of barssince, cum(1), 
  sum, = =, <SPAN 
  >y !=, ++y, 
  but I can’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’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.