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

Re: [amibroker] Re: how to code this



PureBytes Links

Trading Reference Links

Here is an excerpt from Tomasz back in 2002:


I wrote about it many times on this list and it is also explained in the manual.

result = AMA2( array, forward, feedback );

is equivalent to MS:

result = forward * array + feedback * PREV;

Basically it is a first order IIR (infinite impulse response) filter.

With this function you can write all kinds of adaptive exponential-like
smoothing.

So your MS example (close*0.18)+(PREV*0.82)
can be written in AFL as:

result = AMA2( close, 0.18, 0.82 );

or

result = AMA( close, 0.18 );

(AMA is a shorter version that automatically uses feedback factor of
(1-forward))

The only difference is that MS PREV formula is more than 100x slower than AMA.

Best regards,
Tomasz Janeczko
amibroker.com

Does this help ?

Anthony
  ----- Original Message ----- 
  From: das300@xxxxxxxxxx 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, November 09, 2004 10:25 PM
  Subject: [amibroker] Re: how to code this



  I cant see how this would help byt thanks..
  MOZ


  --- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx> 
  wrote:
  > I think AMA() or AMA2() could work. Check the Help manual.
  > 
  > Anthony
  >   ----- Original Message ----- 
  >   From: das300@xxxx 
  >   To: amibroker@xxxxxxxxxxxxxxx 
  >   Sent: Tuesday, November 09, 2004 2:55 PM
  >   Subject: [amibroker] how to code this
  > 
  > 
  > 
  >   i want to code this in AB . In metastock i would have used the 
  PREV 
  >   command but i dont thinkthere is one.
  > 
  >   VALUE[bar no1 ]  = KONSTANT + ([VALUE'i-1]  * Konstant2)
  >   where i = no of bars that have happened , i.e bars = days .
  >   then i wish to plot the VALUE at each i equalling a bar on chart .
  > 
  >   lets say 
  >   Konstant = 2
  >   Konstant2 = 3
  > 
  >   value[day 1] = 2+ 0*3 = 2
  >   value[day 2] = 2+ 2*3 = 8
  >   value[day 3] = 2+ 8*3 = 26
  >   value[day 4] = 2+ 26*3 = 74
  > 
  >   I know it will use arrays and for loop ..but i have little 
  knowledge 
  >   about making it happen ;-)
  >   thanks
  >   MOZ
  > 
  > 
  > 
  > 
  > 
  >   Check AmiBroker web page at:
  >   http://www.amibroker.com/
  > 
  >   Check group FAQ at: 
  http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  > 
  > 
  >         Yahoo! Groups Sponsor 
  >               ADVERTISEMENT
  >              
  >        
  >        
  > 
  > 
  > --------------------------------------------------------------------
  ----------
  >   Yahoo! Groups Links
  > 
  >     a.. To visit your group on the web, go to:
  >     http://groups.yahoo.com/group/amibroker/
  >       
  >     b.. To unsubscribe from this group, send an email to:
  >     amibroker-unsubscribe@xxxxxxxxxxxxxxx
  >       
  >     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
  Service. 
  > 
  > 
  > 
  > [Non-text portions of this message have been removed]





  Check AmiBroker web page at:
  http://www.amibroker.com/

  Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 


        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/
      
    b.. To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/