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

RE: [amibroker] AmiBroker 4.31.0 BETA Examples



PureBytes Links

Trading Reference Links




<FONT face=Arial 
color=#000080>Jason,
Not 
on the last value of H, Y is always the H [see below]]. I'm sure the 
problem  is that if is meant to apply to H[ i ] , not H. 
-Bob
<FONT face=Arial 
color=#000080>---
x=IIf 
(H >=Ref(H,-1),H,L); 
<FONT face=Arial color=#000080 
size=3>/*results in A line touching either the H OR Low of each bar based on the 
condition.*/
if (H >=Ref(H,-1))<FONT 
size=2>
y = H;else
y =L;<FONT 
color=#0000ff size=2>
Plot<FONT face=Arial 
color=#000080>(x,"IFF",colorOrange,4<FONT face=Arial 
color=#000080 size=3>);
Plot<FONT face=Arial 
color=#000080>(y,"if",colorYellow,4<FONT face=Arial 
color=#000080 size=3>);
Plot<FONT face=Arial 
color=#000080>(C,"",4<FONT face=Arial color=#000080 
size=3>,styleCandle);
<FONT face=Arial 
color=#000080 size=3>/*
rather than evaluating the condition 
on A bar by bar basis this looks to
LastValue(H) to determine Y for the 
whole chart. How would I use the
if/else syntax to copy 
IFF? <FONT color=#008000 
size=2>Jayson <FONT 
face="Courier New" color=#008000 size=2>
*/
<FONT 
color=#000080> 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Jayson 
  [mailto:jcasavant@xxxxxxxxxxxx]Sent: Wednesday, April 16, 2003 
  10:26 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
  [amibroker] AmiBroker 4.31.0 BETA Examples
  <SPAN 
  class=586003616-16042003>Anyone, 
  <SPAN 
  class=586003616-16042003> 
  Ok, 
  a very simple example.....
  <SPAN 
  class=586003616-16042003> <FONT 
  size=2>
  
  x=IIf 
  (H 
  >Ref(<FONT 
  color=#000000>H,-<FONT 
  color=#ff00ff>1)<FONT 
  color=#282828>,H<FONT 
  color=#282828>,L<FONT 
  color=#282828>);   this would result 
  in a line touching either the h or low of each bar based on the 
  condition.<SPAN 
  class=586003616-16042003><FONT 
  size=2>
  if (H >Ref(H,-1<FONT 
  face=Arial color=#0000ff size=2>))<FONT 
  face=Arial>
  y = H<FONT face=Arial 
  color=#0000ff>;
  <FONT face=Arial color=#0000ff 
  size=2>else
  y =L;<FONT 
  color=#0000ff>
  Plot(y,<FONT 
  color=#ff00ff>"HL",<FONT 
  color=#000000>colorYellow<FONT 
  size=2>,1<FONT 
  color=#282828>);<FONT 
  color=#0000ff>
  Plot(<FONT 
  color=#000000>C<FONT 
  color=#282828>,""<FONT 
  color=#282828>,4<FONT 
  color=#282828>,<FONT 
  color=#000000>styleCandle<FONT 
  face=Arial size=2>);
   
  <SPAN 
  class=586003616-16042003>rather than evaluating the condition on a bar by bar 
  basis this looks to lastvalue(h) to determine Y for the whole chart. How would 
  I use the if/else syntax to copy IFF?
   Jayson 
  <FONT face=Tahoma 
  size=2>-----Original Message-----From: bluesinvestor 
  [mailto:investor@xxxxxxxxxxxxx]Sent: Wednesday, April 16, 2003 
  11:00 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: 
  [amibroker] AmiBroker 4.31.0 BETA Examples
  
  <SPAN 
  >Actually let me 
  clarify something:
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >condition<FONT 
  face="Arial CE" color=blue size=2><SPAN 
  > expression= 
  i<<SPAN 
  class=SpellE>barcount;         
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means do the 
  loop as long as i< the current <SPAN 
  class=SpellE>barcount (like cum(1))?? 
  <SPAN 
  >YES<FONT 
  face="Courier New" size=2><SPAN 
  >
  <SPAN 
  >this<FONT 
  face=Arial color=navy size=2><SPAN 
  > would actually be 
  something like do the loop as long as i<<SPAN 
  class=SpellE>barcount where barcount = <SPAN 
  class=SpellE>lastvalue(cum(1))
  <SPAN 
  > 
  <SPAN 
  >Regards,
  <SPAN 
  >Peter
  <SPAN 
  > 
  <SPAN 
  >-----Original 
  Message-----From: 
  bluesinvestor [mailto:investor@xxxxxxxxxxxxx] <SPAN 
  >Sent: <st1:date Month="4" 
  Day="16" Year="2003"><SPAN 
  >Wednesday, April 16, 
  2003<SPAN 
  > <st1:time 
  Hour="10" Minute="51"><SPAN 
  >10:51 
  AM<SPAN 
  ><SPAN 
  >To: amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: RE: [amibroker] AmiBroker 4.31.0 
  BETA Examples
  <FONT face="Times New Roman" 
  size=3> 
  <FONT face=Arial color=navy 
  size=2>Hello 
  Jayson,
  <FONT face=Arial color=navy 
  size=2><SPAN 
  > 
  <FONT face=Arial 
  color=blue size=2><SPAN 
  >myema[ 0 ] = close 
  [0];<SPAN 
  >
  <FONT face=Arial color=navy 
  size=2><SPAN 
  > 
  <FONT face=Arial color=navy 
  size=2><SPAN 
  >Amibroker uses zero 
  based arrays meaning that the first record in an array is at the 0 
  position.  Basically this just 
  gives a value to the first myema array.  
  The zero position is the first data record of the close 
  array.
  <FONT face=Arial color=navy 
  size=2><SPAN 
  > 
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >for 
  (<SPAN 
  > <SPAN 
  >init-expression <SPAN 
  >; <SPAN 
  >cond-expression <SPAN 
  >; <SPAN 
  >loop-expression <SPAN 
  >) <SPAN 
  >statement <FONT 
  face="Courier New" size=2><SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >init-expression= 
  i=1;          
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means we start 
  the loop with i=1? <FONT face="Arial CE" 
  color=red size=2><SPAN 
  >YES<FONT 
  face="Courier New" size=2><SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >condition 
  expression= i<barcount;         
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means do the 
  loop as long as i< the current barcount (like cum(1))?? 
  <SPAN 
  >YES<FONT 
  face="Courier New" size=2><SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >loop expression= 
  i<SPAN 
  >++     
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means 
  i+i+i  ??????????<SPAN 
  >  <FONT face="Arial CE" color=red 
  size=2><SPAN 
  >basically this 
  just means i = i + 1<FONT face="Arial CE" 
  color=red><SPAN 
  >
  <FONT face="Arial CE" 
  color=red size=2><SPAN 
  > 
  <FONT face=Arial color=navy 
  size=2>Hope 
  this helps,<SPAN 
  >
  <FONT face=Arial color=navy 
  size=2><SPAN 
  >Peter
  <SPAN 
  > 
  <SPAN 
  >-----Original 
  Message-----From: Jayson 
  [mailto:jcasavant@xxxxxxxxxxxx] <SPAN 
  >Sent: <st1:date Month="4" 
  Day="16" Year="2003"><SPAN 
  >Wednesday, April 16, 
  2003<SPAN 
  > <st1:time 
  Hour="10" Minute="35"><SPAN 
  >10:35 
  AM<SPAN 
  ><SPAN 
  >To: amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: RE: [amibroker] AmiBroker 4.31.0 
  BETA Examples
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face=Arial color=blue 
  size=2>"All you 
  really need to know about new features in AFL<FONT face=Arial 
  color=blue> 
  
  
  <FONT face=Arial color=blue 
  size=2>I 
  described in:<SPAN 
  >
  
  <FONT face=Arial color=blue 
  size=2><SPAN 
  > <FONT 
  face=Arial color=blue><SPAN 
  >
  
  <FONT face=Arial color=blue 
  size=3><A 
  href=""><FONT 
  size=2><SPAN 
  >http://groups.yahoo.com/group/amibroker/message/37591<FONT 
  face=Arial color=blue size=2><SPAN 
  >  
  "<SPAN 
  >
  
  <FONT face=Arial color=blue 
  size=3><SPAN 
  > 
  
  <FONT face=Arial color=blue 
  size=3><SPAN 
  > 
  
  <FONT face=Arial color=blue 
  size=2>Well, 
  almost all........ <SPAN 
  >
  
  <FONT face=Arial color=blue 
  size=2><SPAN 
  > 
  
  <FONT face=Arial color=blue 
  size=2>Tomasz 
  or any one smarter than me,
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face=Arial color=blue 
  size=2>Examples 
  certainly help. But I am still a bit lost.... from the 
  post....
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <SPAN 
  > 
  
  <FONT face=Arial color=red 
  size=2>This 
  example illustrates the for 
  statement: <SPAN 
  ><FONT 
  face=Arial color=red size=2><SPAN 
  > <FONT 
  face="Courier New" size=2><SPAN 
  >
  
  <FONT face="Courier New" 
  color=red size=2>myema[ 0 ] = Close[ 
  0 ];
  
  <FONT face=Arial color=red 
  size=2>for( i = 
  1; i < BarCount; i++ )<FONT face=Arial color=red 
  size=2><SPAN 
  ><FONT 
  face=Arial><SPAN 
  >{<FONT 
  face=Arial>myema[ i ] = 0.1 * Close[ i ] + 
  0.9 * myema[ i - 1 ];<FONT 
  face="Courier New" size=2><SPAN 
  >
  
  <FONT face="Courier New" 
  size=2><SPAN 
  > 
  
  <FONT face=Arial color=blue 
  size=2>myema[ 0 
  ] = close [0];<SPAN 
  >
  
  <FONT face="Courier New" 
  size=2><SPAN 
  > 
  
  <FONT face=Arial color=blue 
  size=2>Do I 
  assume this translates to.....     myema today =close 
  today ??  similar to myema=c;??<FONT 
  face="Courier New" size=2><SPAN 
  >
  
  <FONT face="Courier New" 
  size=2><SPAN 
  > 
  
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >for 
  (<SPAN 
  > <SPAN 
  >init-expression <SPAN 
  >; <SPAN 
  >cond-expression <SPAN 
  >; <SPAN 
  >loop-expression <SPAN 
  >) <SPAN 
  >statement <FONT 
  face="Courier New" size=2><SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >init-expression= 
  i=1;          
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means we start 
  the loop with i=1?<SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >condition 
  expression= i<barcount;         
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >means do the 
  loop as long as i< the current barcount (like 
  cum(1))??<SPAN 
  >
  <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >loop expression= 
  i++     <FONT face="Arial CE" 
  color=blue size=2><SPAN 
  >means 
  i+i+i  ??????????<SPAN 
  >
  
  <FONT face=Arial color=blue 
  size=2>Could 
  someone please convert the expression to 
  english? <SPAN 
  >
  
  <FONT face="Courier New" 
  size=2><SPAN 
  > 
  
  <FONT face="Arial CE" color=blue 
  size=2><SPAN 
  >Tia,<FONT 
  face="Courier New" size=2><SPAN 
  >
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face=Arial color=blue 
  size=2>Jayson 
  
  <P class=MsoNormal 
  ><FONT 
  face=Tahoma size=2><SPAN 
  >-----Original 
  Message-----From: Tomasz 
  Janeczko [mailto:amibroker@xxxxxx]<SPAN 
  >Sent: <st1:date Month="4" 
  Day="16" Year="2003"><SPAN 
  >Wednesday, April 16, 
  2003<SPAN 
  > <st1:time Hour="5" 
  Minute="53"><SPAN 
  >5:53 
  AM<SPAN 
  ><SPAN 
  >To: amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: Re: [amibroker] AmiBroker 4.31.0 
  BETA Examples
  
  <FONT face="Times New Roman" 
  size=2>Hello,
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=2>I fully agree. for/while/if-else + array 
  access is covered
  
  <FONT face="Times New Roman" 
  size=2>on 3 or 4 pages of any C/C++ 
  book
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=2>So this is actually less than 1% of 
  entire C/C++ book.
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=2>So there is absolutely no need to 
  buy/read C++ book
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=2>All you really need to know about new 
  features in AFL
  
  <FONT face="Times New Roman" 
  size=2>I described 
  in:
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=2><A 
  href="">http://groups.yahoo.com/group/amibroker/message/37591
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=3> 
  
  <FONT face="Times New Roman" 
  size=3>Best regards,Tomasz 
  Janeczkoamibroker.com
  <BLOCKQUOTE 
  >
    
    <SPAN 
    >----- Original Message ----- 
    
    
    <FONT 
    face=Arial size=2><SPAN 
    >From:<FONT 
    face=Arial size=2> <A 
    title=uenal.mutlu@xxxxxxxxxxx 
    href="">uenal.mutlu@xxxxxxxxxxx 
    
    
    <SPAN 
    >To:<FONT 
    face=Arial size=2> <A 
    title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    
    
    <SPAN 
    >Sent:<FONT 
    face=Arial size=2> 
    <FONT face=Arial 
    size=2>Wednesday, April 
    16, 2003<SPAN 
    > <st1:time 
    Hour="10" Minute="39"><SPAN 
    >10:39 
    AM<SPAN 
    >
    
    <SPAN 
    >Subject:<FONT 
    face=Arial size=2> Re: 
    [amibroker] AmiBroker 4.31.0 BETA 
Examples
    
    <FONT face="Times New Roman" 
    size=3><SPAN 
    > 
    
    <SPAN 
    >Hi 
    Steve,
    
    <SPAN 
    >C++ is definitely not 
    required to program in AFL;
    
    
    <SPAN 
    >it would be an overkill! 
    C++ covers maybe 10 times 
    
    <SPAN 
    >more stuff than 
    AFL.
    
    <SPAN 
    >The new stuff in AFL is easily 
    learnt within 2 hours.
    
    <SPAN 
    >Simply ask the people here. 
    
    
    <SPAN 
    >UM
    
    <FONT face="Times New Roman" 
    size=3><SPAN 
    > 
    <BLOCKQUOTE 
    >
      
      <SPAN 
      >----- Original Message ----- 
      
      
      <FONT 
      face=Arial size=2><SPAN 
      >From:<FONT 
      face=Arial size=2> <A 
      title=jcasavant@xxxxxxxxxxxx 
      href="">Jayson 
      
      
      <FONT face=Arial 
      size=2><SPAN 
      >To:<FONT 
      face=Arial size=2> <A 
      title=amibroker@xxxxxxxxxxxxxxx 
      href="">amibroker@xxxxxxxxxxxxxxx 
      
      
      <FONT face=Arial 
      size=2><SPAN 
      >Sent:<FONT 
      face=Arial size=2> 
      <FONT face=Arial 
      size=2>Wednesday, April 
      16, 2003<SPAN 
      > <st1:time 
      Hour="6" Minute="50"><SPAN 
      >6:50 
      AM<SPAN 
      >
      
      <FONT face=Arial 
      size=2><SPAN 
      >Subject:<FONT 
      face=Arial size=2> RE: 
      [amibroker] AmiBroker 4.31.0 BETA 
      Examples
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      
      <FONT face=Arial color=blue 
      size=2><SPAN 
      >Thank you Steve, 
      I will see if I can locate a copy.
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      
      <FONT face=Arial color=blue 
      size=2><SPAN 
      >Regards,
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      <FONT face=Arial color=blue 
      size=2><SPAN 
      >Jayson 
      
      <P class=MsoNormal 
      ><FONT 
      face=Tahoma size=2><SPAN 
      >-----Original 
      Message-----From: Steve 
      Dugas [mailto:sjdugas@xxxxxxxxx]<SPAN 
      >Sent: <st1:date 
      Month="4" Day="15" Year="2003"><SPAN 
      >Tuesday, April 15, 
      2003<SPAN 
      > <st1:time 
      Hour="23" Minute="22"><SPAN 
      >11:22 
      PM<SPAN 
      ><SPAN 
      >To: <A 
      href="">amibroker@xxxxxxxxxxxxxxx<SPAN 
      >Subject: Re: [amibroker] AmiBroker 
      4.31.0 BETA Examples
      
      <FONT face="Times New Roman" 
      size=2>Hi 
      Jayson,
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      
      <FONT face="Times New Roman" 
      size=2>Sorry to offer the help and then not 
      be around to follow through on it. But, Monday seems to roll around almost 
      every week these days, and then its off to work again. Better for you 
      though - TJ filled in for me  : - 
      )
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      
      <FONT face="Times New Roman" 
      size=2>I'm not sure what kind of book you 
      would like, but since TJ seems to follow C++ syntax, I can recommend a C++ 
      book that I found to be very good (pretty big though - over 1000 pages). 
      It is very thorough and easy to understand - definitely geared for 
      beginners in my opinion. It is "C++ Primer Plus" by Stephen Prata. I think 
      you could probably just read up on the items you are interested in if you 
      aren't interested in learning the whole language. Be careful because it 
      seems that there are a couple of other C++ books that call themselves 
      "primers", but are definitely NOT for beginners. Especially stay away 
      from Stanley Lippman's book, at least until you have some experience (take 
      it from me....please!).
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      
      <FONT face="Times New Roman" 
      size=2><SPAN 
      >Steve
      
      <FONT face="Times New Roman" 
      size=3><SPAN 
      > 
      <BLOCKQUOTE 
      >
        
        <FONT face=Arial 
        size=2>----- Original 
        Message ----- 
        
        <P class=MsoNormal 
        ><FONT face=Arial 
        size=2><SPAN 
        >From:<FONT 
        face=Arial size=2> <A 
        title=jcasavant@xxxxxxxxxxxx 
        href="">Jayson 
        
        
        <FONT face=Arial 
        size=2><SPAN 
        >To:<FONT 
        face=Arial size=2> <A 
        title=amibroker@xxxxxxxxxxxxxxx 
        href="">amibroker@xxxxxxxxxxxxxxx 
        
        
        <FONT face=Arial 
        size=2><SPAN 
        >Sent:<FONT 
        face=Arial size=2> 
        <FONT face=Arial 
        size=2>Monday, April 
        14, 2003<SPAN 
        > <st1:time 
        Hour="10" Minute="1"><SPAN 
        >10:01 
        AM<SPAN 
        >
        
        <FONT face=Arial 
        size=2><SPAN 
        >Subject:<FONT 
        face=Arial size=2> RE: 
        [amibroker] AmiBroker 4.31.0 BETA 
        Examples
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face=Arial color=blue 
        size=2><SPAN 
        >Thank you 
        Tomasz. I have obviously gone from being fairly high on the learning 
        curve to Newbie in just one week end 
        :(
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face=Arial color=blue 
        size=2><SPAN 
        >Could you 
        recommend a beginner level book that may help some of us get up to speed 
        with this new upgrade? I might as well be reading Japanese , but I don't 
        want to start THAT thread again :))
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        <FONT face=Arial color=blue 
        size=2><SPAN 
        >Jayson 
        
        <P class=MsoNormal 
        ><FONT 
        face=Tahoma size=2><SPAN 
        >-----Original 
        Message-----From: 
        Tomasz Janeczko [mailto:amibroker@xxxxxx]<SPAN 
        >Sent: <st1:date 
        Month="4" Day="14" Year="2003"><SPAN 
        >Monday, April 14, 
        2003<SPAN 
        > <st1:time 
        Hour="3" Minute="54"><SPAN 
        >3:54 
        AM<SPAN 
        ><SPAN 
        >To: 
        amibroker@xxxxxxxxxxxxxxx<SPAN 
        >Subject: Re: [amibroker] AmiBroker 
        4.31.0 BETA Examples
        
        <FONT face="Times New Roman" 
        size=2><SPAN 
        >Hello,
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>While IIF works on 
        ARRAY,
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>if/else works on INDIVIDUAL 
        number/boolean (element of the 
array).
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>Therefore you should write 
        either
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>a1 = IIF( C > Ref( C, -1 ), 1, 0 
        );
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>(or even: a1 = C > Ref( C, -1 
        );
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>or 
        iterate:
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>for( i = 1; i < BarCount; i++ 
        )
        
        <FONT face="Times New Roman" 
        size=2><SPAN 
>{
        
        <FONT face="Times New Roman" 
        size=2>   if  ( Close[ i ] 
        > Close[ i - 1 ] )
        
        <FONT face="Times New Roman" 
        size=2><SPAN 
        >       a1[ i ] = 
        1;
        
        <FONT face="Times New Roman" 
        size=2>   
        else
        
        <FONT face="Times New Roman" 
        size=2><SPAN 
        >       a1[ i 
        ] = 0;
        
        <FONT face="Times New Roman" 
        size=2><SPAN 
>}
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>It is important to understand that 
        IIF is a FUNCTION that works on 
        arrays,
        
        <FONT face="Times New Roman" 
        size=2>while if/else is control flow 
        STATEMENT.
        
        <FONT face="Times New Roman" 
        size=2>Function just evaluates all 
        arguments and returns value(s)
        
        <FONT face="Times New Roman" 
        size=2>Control flow statement changes 
        program flow.
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=2>This is fundamental 
        difference.
        
        <FONT face="Times New Roman" 
        size=3><SPAN 
        > 
        
        <FONT face="Times New Roman" 
        size=3>Best regards,Tomasz 
        Janeczkoamibroker.com
        <BLOCKQUOTE 
        >
          
          <FONT face=Arial 
          size=2>----- 
          Original Message ----- 
          
          <P class=MsoNormal 
          ><FONT face=Arial 
          size=2><SPAN 
          >From:<FONT 
          face=Arial size=2> 
          <A title=jcasavant@xxxxxxxxxxxx 
          href="">Jayson 
          
          
          <FONT face=Arial 
          size=2><SPAN 
          >To:<FONT 
          face=Arial size=2> 
          <A title=amibroker@xxxxxxxxxxxxxxx 
          href="">amibroker@xxxxxxxxxxxxxxx 
          
          
          <FONT face=Arial 
          size=2><SPAN 
          >Sent:<FONT 
          face=Arial size=2> 
          Monday, April 14, 2003 7:55 AM
          
          <FONT face=Arial 
          size=2><SPAN 
          >Subject:<FONT 
          face=Arial size=2> 
          RE: [amibroker] AmiBroker 4.31.0 BETA 
          Examples
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT face=Arial 
          color=blue size=2><SPAN 
          >Steve,
          
          <FONT face=Arial 
          color=blue size=2><SPAN 
          >Your example 
          makes sense yet does not seem to work for me. Else seems to be ignored 
          . Using the IIF this would simply be 
          ......
          
          <FONT face=Arial 
          color=blue size=2><SPAN 
          >a1=iif(c>ref(c,-1),1,0);  
          I am certainly missing something here.... your input 
          appreciated..
          
          <FONT face=Arial 
          color=blue size=2><SPAN 
          >jayson
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT face=Arial 
          color=blue size=2><SPAN 
          ><IMG 
          id=_x0000_i1025 height=638 src="gif00224.gif" width=752 
          align=baseline border=0>
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          <FONT face=Arial 
          color=blue size=2><SPAN 
          >Jayson 
          
          <P class=MsoNormal 
          ><FONT 
          face=Tahoma size=2><SPAN 
          >-----Original 
          Message-----From: 
          Steve Dugas [mailto:sjdugas@xxxxxxxxx]<SPAN 
          >Sent: Sunday, April 13, 2003 
          11:25 AMTo: 
          amibroker@xxxxxxxxxxxxxxx<SPAN 
          >Subject: Re: [amibroker] 
          AmiBroker 4.31.0 BETA Examples
          
          <FONT 
          face="Times New Roman" size=2>Hi 
          Ken,
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=2>I think 
          the concept of loops and if-then-else is the same in all languages. I 
          imagine you  could read up on it at many websites (e.g. 
          - MSDN scripting site). Once you grasp the concept, it is just a 
          matter of using AFL syntax. You would probably use it mostly for 
          iterating your arrays if you wanted to do that. Here is a simple 
          pseudo-code - try coding it in AFL:
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=2>For 
          (SecondBar to LastBar)
          
          <FONT 
          face="Times New Roman" size=2>  If 
          (Today's Close > Yesterday's 
          Close)
          
          <FONT 
          face="Times New Roman" size=2><SPAN 
          >    MyArray = 
          1
          
          <FONT 
          face="Times New Roman" size=2>  
          Else
          
          <FONT 
          face="Times New Roman" size=2><SPAN 
          >    MyArray = 
          0
          
          <FONT 
          face="Times New Roman" size=2>Plot 
          MyArray
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=2>Of course, 
          please feel free to ask for help!
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=2><SPAN 
          >Steve
          
          <FONT 
          face="Times New Roman" size=3><SPAN 
          > 
          
          <FONT 
          face="Times New Roman" size=3>----- 
          Original Message ----- 
          <BLOCKQUOTE 
          >
            
            <P class=MsoNormal 
            ><FONT face=Arial 
            size=2><SPAN 
            >From:<FONT 
            face=Arial size=2> 
            Tomasz 
            Janeczko 
            
            <FONT face=Arial 
            size=2><SPAN 
            >To:<FONT 
            face=Arial size=2> 
            <A title=amibroker@xxxxxxxxxxxxxxx 
            href="">amibroker@xxxxxxxxxxxxxxx 
            
            
            <FONT face=Arial 
            size=2><SPAN 
            >Sent:<FONT 
            face=Arial size=2> 
            Sunday, April 13, 2003 10:39 AM
            
            <FONT face=Arial 
            size=2><SPAN 
            >Subject:<FONT 
            face=Arial size=2> 
            Re: [amibroker] AmiBroker 4.31.0 BETA 
            Examples
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            
            <FONT 
            face="Times New Roman" size=2><SPAN 
            >Ken,
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            
            <FONT 
            face="Times New Roman" size=2>Very 
            nice story :-)
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            
            <FONT 
            face="Times New Roman" size=2>As per 
            your request, attached is a Parabolic SAR formula 
            
            
            <FONT 
            face="Times New Roman" size=2>that I 
            have rewritten from JScript 
            version
            
            <FONT 
            face="Times New Roman" size=2><SPAN 
            >(<A 
            href=""><FONT 
            size=2><SPAN 
            >http://www.amibroker.com/library/detail.php?id=242<FONT 
            size=2><SPAN 
            >)
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            
            <FONT 
            face="Times New Roman" size=2>Best 
            regards,Tomasz 
            Janeczkoamibroker.com
            
            <FONT 
            face="Times New Roman" size=2>----- 
            Original Message ----- 
            
            <FONT 
            face="Times New Roman" size=2>From: 
            "Ken Close" <<A 
            href=""><SPAN 
            >closeks@xxxxxxxx<FONT 
            size=2><SPAN 
            >>
            
            <FONT 
            face="Times New Roman" size=2>To: 
            <<FONT 
            size=2><SPAN 
            >amibroker@xxxxxxxxxxxxxxx<FONT 
            size=2><SPAN 
            >>
            
            <FONT 
            face="Times New Roman" size=2>Sent: 
            Sunday, April 13, 2003 4:05 PM
            
            <FONT 
            face="Times New Roman" size=2>Subject: 
            RE: [amibroker] AmiBroker 4.31.0 BETA 
            Examples
            
            <FONT 
            face="Times New Roman" size=3><SPAN 
            > 
            <FONT 
            face="Times New Roman" size=2>> 
            Tomasz:> > As always, you have good sound 
            advice.  However......> > You say, "Here is a 
            fast sports car, very versatile and powerful.  It> has 7 
            forward gears, but if you are a beginner, do not 
            worry....always> stay in maximum of 4th gear. Plenty of nice 
            driving is possible in 4th> gear.   Wait until you 
            become more experienced before you try gears 5,> 6, and 
            7."> > I say, "Thank you for providing such a nimble 
            sports car, but I am in a> race, and I do not think I can 
            finish even 10th in this race, until I> get out past 4th 
            gear.  If you or others would just provide some more> 
            examples of how to use 5th and 6th gear, then I could more 
            confidently> try them. Maybe even copy your use of them. 
            Then, probably, I will have> enough experience to try 7th 
            gear on my own."> > More examples is all I am asking 
            for....my objective is not to stay in> 4th gear.> 
            > Thanks,> > Ken> > -----Original 
            Message-----> From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
            > Sent: Sunday, April 13, 2003 9:47 AM> To: 
            <FONT 
            size=2><SPAN 
            >amibroker@xxxxxxxxxxxxxxx<FONT 
            size=2>> Subject: Re: [amibroker] 
            AmiBroker 4.31.0 BETA Examples> > Ken,> 
            > > First, additional kudos to Tomasz for another 
            step-jump in capability> of> > Amibroker.> 
            Thank you.> > > Second, a caution, in marketing 
            terms, of having capability that is so> > hard to apply 
            for "non-programmers", beginners, and non-technical> 
            types> > that the extra capability is viewed not as an 
            advantage or benefit,> but> > just the 
            opposite.> > The beginners don't really need to jump 
            into deep water right from> the start as AFL still supports 
            "old-way" of work.> > When you write> > 
            TypicalPrice = (H+L+C) /3;> > it still operates on H, 
            L, C arrays and produces array so no> looping is 
            needed.> > New features are added as 'extra' stuff and 
            do not> change the way old statements work.> > 
            > I apologize - but may speak for many hidden lurkers - that I 
            have just> > mastered the idea that "every AFL statement 
            only executes once", but> now> > I must scramble to 
            reorient my brain for repeated iterations thru AFL> > 
            statements.> > See above - you don't need really to 
            write loops if you don't want them.> All previously written 
            code will execute the same way as before.> > Unless 
            you use a while and/or for loop nothing has really changed.> 
            > So, you don't really need to "re-orient your brain" 
            :-)> > You can view new features as a replacement of 
            JScript/VBScript.> You may use these new features only when 
            you needed to use> scripting in previous versions.> 
            > Best regards,> Tomasz Janeczko> 
            amibroker.com
    <FONT face="Times New Roman" 
    size=3><FONT 
    face="Courier New" size=2>Send BUG REPORTS to 
    bugs@xxxxxxxxxxxxx<SPAN 
    ><FONT 
    face="Courier New">Send SUGGESTIONS to 
    suggest@xxxxxxxxxxxxx<FONT 
    face="Courier New">-----------------------------------------<FONT 
    face="Courier New">Post AmiQuote-related messages ONLY to: 
    amiquote@xxxxxxxxxxxxxxx (Web 
    page: <A 
    href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
    face="Courier New">--------------------------------------------<FONT 
    face="Courier New">Check group FAQ at: <A 
    href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
    <SPAN 
    >Your use of Yahoo! Groups is subject to the <A 
    href="">Yahoo! Terms of 
    Service. 
  <FONT face="Times New Roman" 
  size=3><FONT 
  face="Courier New" size=2>Send BUG REPORTS to 
  bugs@xxxxxxxxxxxxx<SPAN 
  ><FONT 
  face="Courier New">Send SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx<FONT 
  face="Courier New">-----------------------------------------<FONT 
  face="Courier New">Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
  face="Courier New">--------------------------------------------<FONT 
  face="Courier New">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. <BR 
  ><BR 
  >
  <FONT face="Courier New" 
  size=2>Send BUG REPORTS to 
  bugs@xxxxxxxxxxxxx<SPAN 
  ><FONT 
  face="Courier New">Send SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx<FONT 
  face="Courier New">-----------------------------------------<FONT 
  face="Courier New">Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
  face="Courier New">--------------------------------------------<FONT 
  face="Courier New">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. 
  <FONT face="Times New Roman" 
  size=3><BR 
  ><BR 
  ><FONT 
  face="Courier New" size=2>Send BUG REPORTS to 
  bugs@xxxxxxxxxxxxx<SPAN 
  ><FONT 
  face="Courier New">Send SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx<FONT 
  face="Courier New">-----------------------------------------<FONT 
  face="Courier New">Post AmiQuote-related messages ONLY to: 
  amiquote@xxxxxxxxxxxxxxx (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT 
  face="Courier New">--------------------------------------------<FONT 
  face="Courier New">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. 
  Send 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. 
  Send 
  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.


Attachment: Description: ""