PureBytes Links
Trading Reference Links
|
Charles,
It is very simple.
Writing functions is explained in
http://www.amibroker.com/guide/a_language.html
If you want to write a lot of your functions,
I suggest to create the file called
"MyFunctions.afl"
inside
"AFL\Include" subfolder (under AB directory).
In this file place all functions you want to re-use later.
As per your example:
You want to create function called
"dasesfunct" that does returns (H+L) / 2 ;
So you open
MyFunctions.afl file
and type
function dasesfunct()
{
return (H+L)/2;
}
now you save your changes to MyFunctions.afl
Later in ANY formula you like you write #include
statement and you can use all functions that
are declared in MyFunctions.afl file:
#include <MyFunctions.afl>
myarray = dasesfunct() + ATR(14);
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: <das300@xxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, October 21, 2004 6:53 PM
Subject: [amibroker] Re: how to call created Functions-help Thomasz
>
>
> Sorry Thomasz,
> I cant seem to kick off on this..CAN i grab a real quick example..
> SAY i have a function called "Melsfunct"
>
> and in a new function I wish to add ATR(14)
>
> so in essence I want (in a simple text form)
>
> "melsfunct" + ATR(14)
>
> I cant seem to find the format required for this
>
> thanks
> Maurice
>
>
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
> wrote:
>> Hello,
>>
>> AmiBroker has TRUE functions (opposite to MS that does NOT have
> them).
>>
>> In AmiBroker functions allow to PASS parameters, allow local
> variables
>> and allow to return values.
>>
>> Everything is described in the AFL reference:
>> http://www.amibroker.com/guide/a_language.html
>>
>> You can place your functions in separate file and later
>> INCLUDE them using #include statement
>>
>> http://www.amibroker.com/guide/afl/afl_view.php?name=%23include
>>
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>> ----- Original Message -----
>> From: <das300@xxxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Wednesday, October 20, 2004 8:44 AM
>> Subject: [amibroker] how to call created Functions
>>
>>
>> >
>> >
>> > HI ,
>> > QUESTION 1 ) How do I call a function I built into another
> function I
>> > am creating ?
>> >
>> >
>> > QUESTION 1 ) description --------------------------------------->
>> > I am able to call a function that exists in AB eg:
>> > RSI(14);
>> >
>> > My difficulty is say i have a function "dasesfunc"
>> >
>> > dasesfunct
>> >
>> > DS = (H+L) / 2 ;
>> >
>> > lets say I have a new function " newfunct " that uses dasesfunct..
>> >
>> > newfunct
>> >
>> > DS + ATR(14) / DS is the function above /
>> >
>> > How do I call it into this function ????
>> >
>> > regards
>> > das300
>> > maurice
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > 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
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>
>
>
>
>
>
> 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
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/
|