Hello,

Because there is an AMA which does that.
http://www.amibroker.com/f?ama

function EMAp( array, periods )
{
  return AMA( array,  2 / (periods + 1 ) );
}

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: Ton Sieverding 
  To: [email protected] 
  Sent: Wednesday, April 16, 2008 11:01 AM
  Subject: Re: [amibroker] Re: Bollinger Band with variable period in AFL


  Treliff thanks again. Yes that's what also I found when trying these 
functions. Where I do not understand why Tomasz did not make the EMA 'variable 
period' proof. When using an array for the period in EMA it gives me an error 
... Tomasz ?

  Regards, Ton.

    ----- Original Message ----- 
    From: treliff 
    To: [email protected] 
    Sent: Wednesday, April 16, 2008 6:41 AM
    Subject: [amibroker] Re: Bollinger Band with variable period in AFL


    Welcome. FYI: key is to custom-code any static-period indicator by 
    using variable-period ones already available in AFL. Always faster 
    than looping. AFAIK the var-period ones are MA, WMA, DEMA, TEMA, REF, 
    SUM, HHV, LLV, HHVBars and LLVBars.

    -treliff

    --- In [email protected], "Ton Sieverding" 
    <[EMAIL PROTECTED]> wrote:
    >
    > Thanks Treliff. Works fine indeed ...
    > 
    > Regards, Ton.
    > 
    > ----- Original Message ----- 
    > From: treliff 
    > To: [email protected] 
    > Sent: Saturday, April 12, 2008 5:22 AM
    > Subject: [amibroker] Re: Bollinger Band with variable period in 
    AFL
    > 
    > 
    > Ton, function SD_pop below is similar to AFL StDev and can handle 
    > variable periods.
    > 
    > function SD_pop(input,n)
    > { return sqrt( (n*Sum(input^2,n)-(Sum(input,n))^2) / n^2 ); }
    > 
    > -treliff
    > 
    > --- In [email protected], "Ton Sieverding" 
    > <ton.sieverding@> wrote:
    > >
    > > That I understand Bill. And to get the adaptive MA is the easy 
    > part. But how do you get the adaptive standard deviation ? 
    Impossible 
    > in AFL. <Periodes> in StDev() can not be an array ...
    > > 
    > > Regards, Ton.
    > > 
    > > ----- Original Message ----- 
    > > From: wavemechanic 
    > > To: [email protected] 
    > > Sent: Friday, April 11, 2008 6:40 PM
    > > Subject: Re: [amibroker] Bollinger Band with variable period in 
    > AFL
    > > 
    > > 
    > > 
    > > BB is just X standard deviations around a moving average. So, I 
    > suppose one way to go is to use an adaptive moving average (e.g., 
    > Kaufman's) to get an adaptive BB.
    > > 
    > > Bill
    > > 
    > > ----- Original Message ----- 
    > > From: "amsiev" <ton.sieverding@>
    > > To: <[email protected]>
    > > Sent: Friday, April 11, 2008 5:35 AM
    > > Subject: [amibroker] Bollinger Band with variable period in AFL
    > > 
    > > 
    > > > AFL has BBandTop with following syntax : 
    > > > BBandTop( ARRAY, periods = 15, width = 2 ) 
    > > > 
    > > > <Periods> must be numerical. As I want to get a dynamic BB I 
    > need an 
    > > > array in periods. Any suggestions how to get this done ?
    > > > 
    > > > Regards, Ton.
    > > > 
    > > > 
    > > > ------------------------------------
    > > > 
    > > > Please note that this group is for discussion between users 
    > only.
    > > > 
    > > > To get support from AmiBroker please send an e-mail directly 
    to 
    > > > SUPPORT {at} amibroker.com
    > > > 
    > > > For NEW RELEASE ANNOUNCEMENTS and other news always check 
    > DEVLOG:
    > > > http://www.amibroker.com/devlog/
    > > > 
    > > > For other support material please check also:
    > > > http://www.amibroker.com/support.html
    > > > Yahoo! Groups Links
    > > > 
    > > > 
    > > > 
    > > > 
    > > > 
    > > > -- 
    > > > No virus found in this incoming message.
    > > > Checked by AVG. 
    > > > Version: 7.5.519 / Virus Database: 269.22.12/1372 - Release 
    > Date: 4/10/2008 5:36 PM
    > > > 
    > > >
    > >
    >



   

Reply via email to