Hi Fernando
I'm not aware of any functions that won't work with
a re-used variable name. One thing you have to take care with is that you
don't redefine a variable before the original definition has fulfilled its
intended purpose(s). The "top to bottom" processing of any MetaStock
formula makes it fairly easy to keep various definitions in the proper
order. However, there's always a possibility of getting it wrong and
having to go look for the problem. I spent some time chasing my tail with just
this situation earlier today.
Remember that you can use a previous
definition as part of a new definition. The old definition
remains current until the new definition has been completed. Think of MetaStock
as reading the old definition, including it in the new one, and only saving it
over the top of the old definition once it has fully assembled the new
definition.
When a formula has multiple outputs it's usually
possible to leave each output unnamed. This effectively allows the use of more
variables without using up more names from the quota of 20.
Another thing to watch out for is that a new
definition can retain old data (in the N/A portion if there is one. I've seen
instances where this data has had unexpected and unwanted effects on
subsequent code lines. An effective way to eliminate this possibility from
happening is to redefine the name to zero or some other suitable constant, thus
clearing all existing data before applying the intended new
definition.
There was something else that I was going to
mention but it's slipped from my mind for the moment, sorry :-(
Something else that most users are not aware of is
that an MS formula can only accept 40 constants in a formula. This can be
overcome, although the solution is somewhat clumsy, by adding two constants
together. Instead of writing "45" you could write "30+15". Accepted
constants can be almost any number and are not restricted to 0-39 (or
1-41).
Regards
Roy
----- Original Message -----
Sent: Tuesday, October 28, 2008 7:42
PM
Subject: [EquisMetaStock Group] variable
rules
Hi.
To surpass the 20 variable limit of MS we can use the same
variable name several times but there must be some rules for
this.
Is there any functions that don't allow us to use the same
variable name several times?
regards, Fernando
__________ NOD32 3561 (20081027)
Information __________
This message was checked by NOD32 antivirus
system. http://www.eset.com
__._,_.___
__,_._,___
|