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

[amibroker] A problem with DAX & Amiquote



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen" 
<psytek@xxxx> wrote:
> Tomasz,
> 
> Please forgive my ignorance but I totally seem to miss the 
significance of
> dynamic variables... Unless you can convince me otherwise I think I 
would
> have preferred to see the introduction of traditional 
multidimensional
> tables that can be used in standard math routines...why is this 
better or
> more versatile in the field of technical analysis? ... I have lots 
lots of
> questions:
> 
> 1) Can dynamic variables be used to implement multidimensional 
random access
> tables, like TableA(k,i,j) ?
> 2) Are there any limits to the number of dynamic variables we can 
create?
> 3) Can dynamic variables handle only arrays or also numbers and 
strings, if
> so how to define one or the other?

> 4) Can we use multiple 'subscripts' like SetVar("VarA"+i+j+k, 
somenumber) to
> simulate tradional tables?

Herman,
You may define 100 periods in an empty IB window 
//Master
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
{
StaticVarSet( "per"+WriteVal(i,1.0)+WriteVal(j,1.0), 10*i+j);
}
}

and then use them in other IB windows
 
Plot(MA(C,StaticVarGet("per04")),"["+WriteVal(StaticVarGet
("per04"),1.0)+"]",1,1);
Plot(MA(C,StaticVarGet("per40")),"["+WriteVal(StaticVarGet
("per40"),1.0)+"]",2,1);

As you see, the value of each perXX may be a meaningful expression of 
i and j.
Dimitris Tsokakis
> 5) Is there any way to save them on disk?
> 6) Could you give a non-trivial example/application?
> 
> many thanks for any light you can shed on this!
> herman.
>   -----Original Message-----
>   From: Tomasz Janeczko [mailto:amibroker@x...]
>   Sent: Saturday, July 10, 2004 5:37 PM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: Re: [amibroker] Question on VarSet and VarGet for Tomasz 
and
> programming gurus
> 
> 
>   Gary,
> 
>   One example (trivial) application:
> 
>   instead of writing:
> 
>   C1 = Ref( C, -1 );
>   C2 = Ref( C, -2 );
>   C3 = Ref( C, -3 );
>   C4 = Ref( C, -4 );
>   C5 = Ref( C, -5 );
>   C6 = Ref( C, -6 );
>   C7 = Ref( C, -7 );
>   C8 = Ref( C, -8 );
>   C9 = Ref( C, -9 );
> 
>   You can now write single line that will have the same effect
> 
>   for( i = 1; i < 10; i++ ) VarSet( "C"+i, Ref( C, -i ) );
> 
> 
>   Best regards,
>   Tomasz Janeczko
>   amibroker.com
>     ----- Original Message -----
>     From: Gary A. Serkhoshian
>     To: amibroker@xxxxxxxxxxxxxxx
>     Sent: Saturday, July 10, 2004 11:17 PM
>     Subject: [amibroker] Question on VarSet and VarGet for Tomasz 
and
> programming gurus
> 
> 
>     Tomasz,
> 
>     For us non-programmers, I get the sense of importance that 
VarSet and
> VarGet offer, but not in the practical sense.
> 
>     For PT, is there a way to find out which positions are open, 
what there
> positionscores are, etc. using these functions.
> 
>     I'm sure you have some very practical reasons for offering such
> functionality, but I'm not seeing it.
> 
>     Thanks,
>     Gary
> 
> 
>     Tomasz Janeczko <amibroker@xxxx> wrote:
>       Correct Dimitris.
>       StaticVarSet / StaticVarGet.
> 
>       Best regards,
>       Tomasz Janeczko
>       amibroker.com
>       ----- Original Message -----
>       From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
>       To: <amibroker@xxxxxxxxxxxxxxx>
>       Sent: Saturday, July 10, 2004 10:30 AM
>       Subject: [amibroker] Re: Static variables
> 
> 
>       > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" 
<amibroker@xxxx>
>       > wrote:
>       > > Hello,
>       > >
>       > > I received the following two questions by support channel
>       > > and thought that reply may interest more people:
>       > >
>       > > Q1.   What is the difference between    StaticSetVar
("x",5); and
>       > x=5;
>       > >
>       > Tomasz,
>       > I suppose you mean StaticVarSet("x",5).
>       > Dimitris Tsokakis
>       > > A1: Read me says:
>       > > ** Static variable - the variable has static duration (it 
is
>       > allocated when the program begins and deallocated when the 
program
>       > > ends)
>       > > and initializes it to Null unless another value is 
specified.
>       > Static variables allow to share values between various 
formulas.
>       > > Only NUMBER and STRING static variables are supported now 
(not
>       > ARRAYS).
>       > >
>       > > So, speaking about the difference
>       > > x=5; is regular variable that "lives" only DURING 
execution of the
>       > formula.
>       > >
>       > > StaticSetVar("x",5);
>       > > - gives you an access to static data storage that REMAINS 
between
>       > execution of formulas (as long AmiBroker is running)
>       > > and is accessible from ANY formula.
>       > > You can call StaticGetVar("x") from a DIFFERENT formula 
and you
>       > will get the value set  from another formula.
>       > >
>       > > So Static variables are BOTH persistent (as long as 
AmiBroker is
>       > running) and global (in "wider" scope - between different 
formulas)
>       > >
>       > > Static variables can be used instead of external files to 
store
>       > values between formula invocations.
>       > >
>       > >
>       > > -----------
>       > > Q2. Can I access vars that are defined in a DLL by using
>       > StaticVarGet?
>       > >
>       > > A2: Only if you create them using StaticVarSet.
>       > > (You can call StaticVarSet from DLL using 
gSite.CallFunction)
>       > >
>       > >
>       > > Best regards,
>       > > Tomasz Janeczko
>       > > amibroker.com
>       >
>       >
>       >
>       >
>       > 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
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
>     Do you Yahoo!?
>     Yahoo! Mail - Helps protect you from nasty viruses.
> 
>     Check AmiBroker web page at:
>     http://www.amibroker.com/
> 
>     Check group FAQ at:
> 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
> 
>       a.. To visit your group on the web, go to:
>       http://groups.yahoo.com/group/amibroker/
> 
>       b.. To unsubscribe from this group, send an email to:
>       amibroker-unsubscribe@xxxxxxxxxxxxxxx
> 
>       c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of
> Service.



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

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/