PureBytes Links
Trading Reference Links
|
Roy & Jose,
Many thanks to you both. Even though I have been using MS for years, I still
learn something new from you both. Hmmm...using the same name more than once
is a neat way to sidestep MS 20-var limit in custom formulas..may try it
some day. Just curious to know - did you learn this trick through trial and
error? Roy, you *must* mention this trick in your book for the benefit of
all MS users worldwide.
JD
==========================================
From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx>
Reply-To: equismetastock@xxxxxxxxxxxxxxx
To: <equismetastock@xxxxxxxxxxxxxxx>
Subject: Re: [EquisMetaStock Group] Re: How to remove 3 highest/lowest
values in a range
Date: Wed, 24 Mar 2004 14:38:21 +1200
JD
> Believe me I know MS's limitations! I was just curious when you use the
same
> name twice, does MS "process" just the 2nd one or both?
MS processes everything in an orderly sequence. Just as it moves from bar
one on the left bar-by-bar
to the right in sequence so it moves from the top of an indictor to the
bottom, one variable/line at
a time.
Once a variable is created the result is available for all subsequent code
to use. The existing
value of this variable can now be modified to include some other parameter
over and above it's
existing definition, or it can be recreated as something entirely new.
When modified or recreated (variable name is reused for a completely
different function) any prior
use of this variable name within the indicator (or exploration etc) is still
valid but only the new
definition is valid for subsequent use.
In practical terms what this means is that a variable name can be used
several times for several
different purposes within one indicator, but an FmlVar() call from somewhere
else can only access
the LAST definition.
It's all to do with the bar-by-bar and line-by-line sequential processing.
This ability to modify or
redefine variables blows the 20 variable limit out of the water. Space then
becomes more of a
problem.
Roy
==============================
John,
MFL (MetaStock Formula Language) processes variables in sequential
order, from top to bottom lines of code (left to right bars on charts)
. Any reused variable will overwrite the previous one. The same
applies for variables reused in the same line of MS code.
"Finally, in the the last argument
"[xBoxedAvg:=Sum(If(x=xBoxed,x,0),pds)/xBoxedPds;], MS will refer to
which xBoxedPrds - the 1st or the 2nd?"
The last one, i.e. 2nd.
"Just curious to know..."
Curiosity is essential in this game. It's more important than
"intelligence", and is only surpassed by persistence in terms of
success.
jose '-)
--- In equismetastock@xxxxxxxxxxxxxxx, "John Doe" <ms001122@xxxx>
wrote:
>Jose,
>
>Believe me I know MS's limitations! I was just curious when you use
the same
>name twice, does MS "process" just the 2nd one or both? Also, your
2nd use
>of xBoxedPrds itself refers to xBoxedPeriods
>[xBoxedPds:=If(xBoxedPds=0,.000001,xBoxedPds);] - can this create
errors?
>Finally, in the the last argument
>[xBoxedAvg:=Sum(If(x=xBoxed,x,0),pds)/xBoxedPds;], MS will refer to
which
>xBoxedPrds - the 1st or the 2nd? Just curious to know...
>
>JD
>=======================================================
_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE!
http://toolbar.msn.com/go/onm00200414ave/direct/01/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|