PureBytes Links
Trading Reference Links
|
Hello,
Dynamic variable is just regular variable with
dynamic identifier (name).
1. The scope is global to the formula that created
the variable. It means that you can access it from anywhere in the
formula
that created it. But you can NOT access it from
other formulas (i.e. dynamic variable is NOT pesistent or
static)
2. No. Dynamic variables support _numeric_ and
_array_ type as of now.
Dynamic variable DOES NOT DIFFER from regular AFL
variable, it is the SAME variable but it just has ability to have
dynamic identifier.
See this:
VarSet( "myvariable", 5 );
if( myvariable == 5 ) // this 'dynamic
variable' works exactly as regular variable and can be accessed regular
way
{
printf("myvariable has value of
5");
}
Dynamic variables were added just to allow writing
a loop:
for( i = 1; i <= 5; i++ ) VarSet( "Var"+i,
Ref( C, -i ) );
instead of 5 statements:
Var1 = Ref( C, -1 );
Var2 = Ref( C, -2 );
Var3 = Ref( C, -3 );
Var4 = Ref( C, -4 );
Var5 = Ref( C, -5
);
but both approaches have the SAME EFFECT ->
creation of five regular variables called Var1, ...., Var5
The only "dynamic" thing about dynamic variables is
its name (identifier).
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Ara Kaloustian
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">AB-Main
Sent: Friday, August 06, 2004 7:48
AM
Subject: [amibroker] Dynamic
Variables
The read me files describe Dynamic variables as
* Dynamic variables are variables that are named dynamically,
typically by creating a variable name from a static part and a variable part.
For example, the following example dynamically constructs the variable name
from a variable prefix and a static suffix.<FONT
color=#000000>for<FONT
color=#000000>( i = 1; i
< 10; i++ ) {
VarSet( <FONT
color=#ff00ff>"C"+i, <FONT
color=#0000ff>Ref( <FONT
color=#000000>C, -i ) ); }
// creates variables C1, C2, C3, C4, ....,
C10 equal to Ref( C, -1 ), Ref( C, -2 ), ..., Ref( C, -10
) //
respectively
However
there is no mention of its other properties, such
as:
1. Scope of variable: I assume it to be
same as for Static Variables
2. Types of values: I assume they are
NUMBER and SRTING only, same as for Static variables.
Can anyone confirm
this?
Thanks
Ara
Check AmiBroker web page at:<A
href="">http://www.amibroker.com/Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
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
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 the Yahoo! Terms of Service.
|