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

Re: [amibroker] Re: how bad was Tokyo today?



PureBytes Links

Trading Reference Links

Graham,

for the time being therwe is no difference between functions and procedures
in AB.

Typically Functions return one value, while Procedures return none.... and
TJ will probably implement it that way later.

In order to get multiple variable reurned, you can do it in 2 ways:

1. Make multiple calls to the function and select what to return.
Example:

function Calculate(Input1, Input2,....,returnvariable)
{
// calculate variables

returnparam
if (return variable == 1)  returnparameter = variable1;
if (return variable == 2)  returnparameter = variable2;
etc.

return returnparameter;
}


or you can define all the parameters you want as global variables and once
you call the function all variables will have the correct value

Ara

----- Original Message ----- 
From: "Graham" <gkavanagh@xxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, May 10, 2004 3:32 PM
Subject: [amibroker] Functions and procedures


> The difference between functions and procedures is something I have
trouble
> understanding even after reading the descriptions in the help files.
Hoping
> someone can provide me with where procedures could be used instead of a
> function.
>
> Secondly I would like to run explorations using a fairly complex code and
> have multiple outputs. An example is I want to run various P&F codes with
> different box sizes to find various signals. My attempts have found that I
> can only get one variable out of a function. Is this correct? So far I
> basically set up the base code in an #include file and declare the input
> variable before the include statements
>
> Eg
>
> Reverse = 3  ;      // reversal requirement
> #pragma nocache
> #include "C:\Program Files\AmiBroker\AFL PF System\PnF System Base.afl"
>
> Reverse = 6  ;      // reversal requirement
> #pragma nocache
> #include "C:\Program Files\AmiBroker\AFL PF System\PnF System Base.afl"
>
> Unfortunately when I do this I must then reassign local names to the
outputs
> from the base file for each output. My system has many outputs that I use,
> eg Average column length, average bars per column, average inactive bars
> etc.
>
> Hope this is clear what I am trying to do and any help appreciated. A
> multiple output function, or another method, could save a lot of my typing
>
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/
>
>
>
>
>
> 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
> Yahoo! Groups Links
>
>
>
>
>




------------------------ 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
---------------------------------------------------------------------~->

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