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

[amibroker] Re: Are all variables Array data types?


  • Date: Tue, 15 Dec 2009 13:13:10 -0000
  • From: "progster01" <progster@xxxxxxxxxxxxxxxxxx>
  • Subject: [amibroker] Re: Are all variables Array data types?

PureBytes Links

Trading Reference Links

Of course this works.  arg is an array.  arg[0], arg[1], etc. are scalars (numbers).

You can stuff an array and then cherry-pick numbers from it, no problem.  One thing to keep in mind though is that if you are using an index to do your cherry picking,  (e.g.  arg[ndx] ) the index needs to be always defined at the point you are using it.

Further, if you are looping over that index, then within the loop all the unadorned array names you use will be expected to have subscripts.  IOW, you can't write "naked" array code inside a for loop (though you can pass arrays to functions and get them back).

The way I've come to look at it is that when I have a loop in my code( any loop, not just a 0 -> (BarCount - 1) loop ), I am in a "loop environment" for the duration of the loop, and must alter my authorship accordingly.



--- In amibroker@xxxxxxxxxxxxxxx, "reefbreak_sd" <reefbreak_sd@xxx> wrote:
>
> Not to beat this to death, but I have used 
> arg[0] = 3.14159
> arg[1] = sqrt(2)
> arg[2] = 2.7182
> arg[3] = 1.61803
> to refer to numbers - not arrays.  Then they will work in 'if' statements like:
> 
> if(arg[2] > arg[1]) 
> arg[4]=1;
> else
> arg[4]=0;
> 
> 
> ReefBreak
> 
> 
> 
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "peter843" <yahoogroups@> wrote:
> >
> > I thought it over and I see now why it is good for 'iif' to return an array.
> > 
> > The 'selectedvalue' will take care of my needs.
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "peter843" <yahoogroups@> wrote:
> >  
> > > What puzzles me is that "x = IIf( Close > Open, 1, 0 );" seems to create an array variable even though it is being assigned a 1 or 0.
> >
>




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

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/