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

[amibroker] Re: how to detect if a foreign symbol is an index or not



PureBytes Links

Trading Reference Links

Hello,

The answer is simple:
variables are used not only on the left side of the assignment
so yours "as long as the  name begins with a letter, has no spaces, and is followed by an equal  sign"
is not really true.

 
> For example, in naming an up gap variable, it would be nice to be 
> able to use the % sign to identify the size of the gap, and also 
> use "." for fractional percentages

Both % and . are OPERATORS in AFL.
% is MODULUS operator
and . is member access operator.
http://www.amibroker.com/guide/a_language.html
http://www.amibroker.com/guide/a_aflcom.html

For example:

var1 = 12;
var2 = 10;

x = var1%var2;

means x should be equal to the reminder from division of var1 by var2

Also . is an operator (object member access):

AB = CreateObject("Broker.Applicaiton");
AB.RefreshAll();



Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "seneca_kw" <wellswellskw@xxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, July 23, 2004 8:01 PM
Subject: [amibroker] Why limit variable names?


> >From the User's Guide:
> 
> "Identifiers are arbitrary names of any length given to functions and 
> variables. Identifiers can contain the letters (a-z, A-Z), the 
> underscore character ("_"), and the digits (0-9). The first character 
> must be a letter."
> 
> I've confirmed through experimentation that AB won't accept other 
> characters in a variable name.  Why this limitation?  As long as the 
> name begins with a letter, has no spaces, and is followed by an equal 
> sign, wouldn't that be enough to confirm that it's a variable and 
> nothing else?  It'd be nice to be able to use the full range of 
> characters and signs.
> 
> This may seem like a small point, but I'm developing a large library 
> of variables for repeated use.  I'd like the variable names to 
> contain enough information that: 1) I can recall them without having 
> to look them up;  2) I recognize what they mean when I see them in a 
> formula without having to look them up.
> 
> For example, in naming an up gap variable, it would be nice to be 
> able to use the % sign to identify the size of the gap, and also 
> use "." for fractional percentages. I'm trying to work around it 
> using round about ways (eg "PC" instead of the percent sign) but the 
> results are longer than necessary and not as clear.
> 
> I'd appreciate any workaround ideas.
> 
> Thanks, Wayne
> 
> 
> 
> 
> 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 --------------------~--> 
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/