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

Re: [amibroker] Using Functions to Process Arrays



PureBytes Links

Trading Reference Links

Hi - Don't know of any tutorial but not sure you really need one. Do you 
understand basic looping already? You could start with any inline looping 
code. Once you have that working and understand it, you can just wrap it in 
a function and pass it the arrays it needs via the function args. Also, make 
sure the function is defined before it is called. I believe there are a 
couple of of looping tutorials in the files section, I wrote a very brief 
one and I think it was GP that wrote a better one. If you have something you 
can't get to work, feel free to post it...

Steve

----- Original Message ----- 
From: "Pete" <dryheat3@xxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, August 09, 2008 6:37 PM
Subject: [amibroker] Using Functions to Process Arrays


>I have a bit of experience with building functions in VBA so I get the
> basic concept. But the projects I've built in the past did not rely
> heavily on processing arrays within functions. What I would really
> like is to get my brain around this so I understand exactly what's
> taking place and, hopefully, to better apply this technique to my AFL
> coding.
> From the AB help files:
> I simple function for a second order smoother:
> //begin code ************************************
> function IIR2( input, f0, f1, f2 )
> {
>    result[ 0 ] = input[ 0 ];
>    result[ 1 ] = input[ 1 ];
>
>    for( i = 2; i < BarCount; i++ )
>    {
>       result[ i ] = f0 * input[ i ] +
>                     f1 * result[ i - 1 ] +
>                     f2 * result[ i - 2 ];
>    }
>
>   return result;
> }
> //end code ***************************************
>
> Do any of you know where I can get a quick and easy tutorial on
> processing arrays in functions so I can better understand how this
> looping works?
>
>  Pete  :-)
>
>
> ------------------------------------
>
> 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
>
>
>
> 



------------------------------------

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

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/