PureBytes Links
Trading Reference Links
|
<x-html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.3825.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2>Then use the "PlotOrNoPlot" function, one that will ALWAYS
ONLY plot on and<BR>from the Entry day onwards, eg and then make the right
changes and alterations<BR>to it so it can be used in your WCVFI -
indicator.<BR><BR>The below formula will automaticaly add 1 day to the
indicator's Traded Periods<BR>value for the previous day, and tho the PREV
function is in it, it is figurely not used<BR>and will not actualy calculate
{and/or slowdown the process}.<BR><BR>Name: PlotOrNoPlot<BR>Formula:<BR>Day1 :=
Input("Day of Trade",1,31,4);<BR>Month1 := Input("Month of
Trade",1,12,1);<BR>Year1 := Input("Year of
Trade",1900,2400,2000);<BR>PdsTrade:=BarsSince(DayOfMonth()=Day1 AND Month()=
Month1 AND Year()= Year1);<BR>If(PdsTrade>0,PdsTrade,PREV)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Also using a Last Value() function-example is printed, in
the "MSK's Formula FAQ # 3 - Variables",</FONT></DIV>
<DIV><FONT size=2>on the bottom of this mail.<BR><BR>Regards,<BR>Ton
Maas<BR></FONT><A href="mailto:ms-irb@xxxxxxxxxxxxxxxx"><FONT
size=2>ms-irb@xxxxxxxxxxxxxxxx</FONT></A><BR><FONT size=2>Dismiss the ".nospam"
bit (including the dot) when replying.<BR>Homepage </FONT><A
href="http://home.planet.nl/~anthmaas"><FONT
size=2>http://home.planet.nl/~anthmaas</FONT></A><BR><BR><BR><FONT size=2>-----
Original Message ----- <BR>From: "Michel Amelinckx"<BR>To: <</FONT><A
href="mailto:metastock@xxxxxxxxxxxxx"><FONT
size=2>metastock@xxxxxxxxxxxxx</FONT></A><FONT size=2>><BR>Sent: dinsdag 12
september 2000 14:13<BR>Subject: RE: WCVFI - Float Analysis<BR><BR><BR>> I
don't think it can be done WITHOUT MSDK. Although nice try, problem
with<BR>> CUM() is that it starts counting from start of data till end of
data. And<BR>> for the WCVFI it has to start counting from entry date
backwards.<BR>> <BR>> Anyone here with MSDK who is willing to help us out
here ?????????<BR>> <BR>> Mickey<BR>> <BR>> > -----Original
Message-----<BR>> > From: </FONT><A
href="mailto:owner-metastock@xxxxxxxxxxxxx"><FONT
size=2>owner-metastock@xxxxxxxxxxxxx</FONT></A><BR><FONT size=2>> >
[mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of leo.timmermans.lt<BR>>
> Sent: dinsdag 12 september 2000 8:11<BR>> > To: - </FONT><A
href="mailto:*metastock@xxxxxxxxxxxxx"><FONT
size=2>*metastock@xxxxxxxxxxxxx</FONT></A><BR><FONT size=2>> > Subject:
WCVFI - Float Analysis<BR>> ><BR>> ><BR>> > Hello,<BR>>
><BR>> > I think the next code comes near the WCVFI.<BR>>
><BR>> > nshares:=input("# shares : ",1,1000000000,1000000);<BR>>
> {nshares is the floating amount of shares}<BR>> >
totalvolume:=lastvalue(cum(v));<BR>> >
if(cum(v)>(totalvolume-nshares),+1,-1);<BR>> ><BR>> > Any
comments, improvements ....<BR>> ><BR>> > Again, I'm sure that
someone with the MSDK could do the job<BR>> > completely in 2<BR>> >
minutes.<BR>> > Anybody willing to take the challenge ....<BR>>
><BR>> > Regards,<BR>> >
Leo<BR>=====================================================</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV>
<DIV><FONT size=2>
<DIV><FONT size=2><STRONG>MSK Formula FAQ's + Tips</STRONG></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff><STRONG>Q3.
</STRONG></FONT></FONT></FONT><FONT size=2><STRONG><FONT size=4>Variables:
</FONT><FONT size=3>How To Make 'Soft' values
'Hard'......................</FONT></STRONG></FONT></DIV>
<DIV><FONT size=2><FONT size=3><STRONG>
</STRONG><FONT size=2>(and u</FONT><FONT size=2>sing Variables in MSK:
how a "Variable" is turned into a "Constant").</FONT></DIV></FONT></FONT>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG><FONT size=2>Using variables in Formulas(+Functions) in
MSKv.65+:</FONT></STRONG></DIV>
<DIV><FONT size=2>
<DIV><FONT size=2><STRONG>-</STRONG>How</FONT><FONT size=3> </FONT><FONT
size=2>a <STRONG>"Variable's <EM><U>static</U> </EM></STRONG>(pre-defined)
<STRONG>Numeric value" </STRONG>turned <STRONG>"Numeric
Constant"</STRONG></FONT></DIV>
<DIV><FONT
size=2><STRONG> </STRONG>topic:
<STRONG>Using
</STRONG><EM><U><STRONG>pre-set</STRONG></U></EM> <STRONG>Variables to
Represent Numbers (Numerical Constants) (Part
1).</STRONG></FONT></DIV></FONT></DIV>
<DIV><FONT size=2><STRONG>-</STRONG>How</FONT><FONT size=3> </FONT><FONT
size=2>a <STRONG>"Variable's <EM><U>dynamic</U> </EM></STRONG>(later calculated)
<STRONG>Numeric value" </STRONG>turned <STRONG>"Numeric
Constant"</STRONG></FONT></DIV>
<DIV><FONT
size=2><STRONG>
</STRONG>topic: <STRONG>Using
</STRONG><EM><U><STRONG>calculated</STRONG></U></EM> <STRONG>Variables to
Represent Numbers (Numerical Constants) (Part 2).</STRONG></FONT></DIV>
<DIV><STRONG><FONT size=2></FONT></STRONG> </DIV><FONT size=2></FONT></DIV>
<DIV><FONT size=3><STRONG></STRONG></FONT></DIV>
<DIV><STRONG><U><FONT size=3>Using <EM>calculated </EM>Variables to Represent
Numbers (Numerical Constants) (part 2)</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2><STRONG>How an in a Variable
<EM><U>calculated</U></EM></STRONG> <STRONG>Numeric value, eg the
<EM>soft </EM>"Variable", is turned into a (surrogate) <EM>hard
</EM>"Numeric Constant".</STRONG></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-<STRONG>Soft </STRONG>coded values are the by a Function's
<STRONG>later </STRONG><EM>defined <U><STRONG>calculated
</STRONG></U></EM>values.</FONT></DIV>
<DIV><FONT size=2>-<STRONG>Hard </STRONG>coded values are <U><EM><STRONG>pre-set
</STRONG></EM></U>values, eg <EM>defined </EM><STRONG>on creation
</STRONG>of Formula ('s Function)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>Variable values can then be created in MSK by
using the VA Operator (Varable Assignment, see part 1) and by referencing
(inputting) </FONT><FONT size=2>that Variable in(to) another
Function.</DIV></FONT>
<DIV><FONT size=2>For example by using: {among many of the other
available variable-values-returning Functions}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-the CALL Function</FONT></DIV>
<DIV>-the BARS SINCE Function</DIV>
<DIV><FONT size=2>-the LAST VALUE Function</FONT></DIV>
<DIV><FONT size=2>etc. etc..</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2></DIV></FONT>
<DIV><FONT size=2></FONT></FONT><FONT size=2>The (surrogative) "Hard" coded
values (Variable's <STRONG><EM><U>calculated </U></EM></STRONG>Numeric
Constants) can then be derived form Soft coded values, and can be
</FONT><FONT size=2>inputted in(to) a Function using </FONT><FONT size=2>the
LastValue(DATA ARRAY) Function (nesting the fuction into a function).
</DIV></DIV>
<DIV>
<DIV><FONT size=2>This </FONT><FONT size=2>to enable for the MSK Formula
interpreter (the Formula debugger) to accept the Variable's
<U><EM><STRONG>calculated</STRONG></EM></U> last value </FONT><FONT size=2>as a
(Numerical) Constant in the (now nested) Function's
Variable</FONT><FONT size=2> value or Expression value.</DIV></FONT></FONT>
<DIV><FONT size=2>For Example:</DIV></DIV></FONT>
<DIV><FONT size=2></FONT> </DIV></DIV>
<DIV><FONT size=3>Day1 := Input("Day of Trade",1,31,4);<BR>Month1 :=
Input("Month of Trade",1,12,1);<BR>Year1 := Input("Year of
Trade",1900,2400,2000);<BR>PdsTrade:=BarsSince(DayOfMonth()=Day1 AND Month()=
Month1 AND Year()= Year1);<BR>HHVStop:=
HHV(H,LastValue(PdsTrade));<BR>HHVStop</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>Here the variable's last value calculated for the
"PdsTrade"-<STRONG>Variable</STRONG>, is made into a (hard coded)
<STRONG>Constant </STRONG>using the nested LastValue()
<STRONG>Function</STRONG>.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><STRONG><U><FONT size=3>Last Value in Data Array</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>SYNTAX lastvalue(DATA
ARRAY)<BR>FUNCTION This function loads an entire data array
with the last calculated value of the specified DATA ARRAY.</FONT></DIV>
<DIV><FONT
size=2> The
result of this function can be used in place of a constant in any function
argument.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If DATA ARRAY is undefined (e.g., only 100-days loaded and you
request the last value of a 200-day moving average) then the lastvalue function
returns zero.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Since this function loads an entire data array with the last
value of another array, it allows a formula to look into the
future.</FONT></DIV>
<DIV><FONT size=2>This is unacceptable for most indicators, but is very
beneficial for things like pattern recognition.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>EXAMPLE The formula mov(close,lastvalue(fml("Determine
Periods")),s) calculates a moving average using</FONT></DIV>
<DIV><FONT
size=2>
the number of periods returned by the indicator named "Determine
Periods".</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><STRONG><U><FONT size=3>The Zig Zag and Lastvalue()
Trap</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>The Zig Zag indicator (see Zig Zag) uses 20/20 hindsight to
filter out fluctuations. It shows only price movements that are equal to
or greater than the amount specified. However, the Zig Zag indicator
determines this "after the fact" (an advantage a trader doesn't have).
With that said, be careful about using the Zig Zag indicator in a system
test. It will produce results that are not attainable in real
trading.</FONT></DIV>
<DIV><FONT size=2><BR>The Lastvalue() function (see <STRONG>Last Value in Data
Array</STRONG>) can see into the future in that it returns the last value of a
data array. For example, a system test could be written that bases a trade
on a future price or indicator value—something unattainable in real-life.
Although it has value for things like pattern recognition, it should rarely (if
ever) be used in a system test, as it will provide the system test with
unattainable information.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><STRONG><U><FONT
size=3>----------------------------------------------------------------------------------------------------</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2><STRONG><FONT size=4>Variables:
General</FONT></STRONG></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>
<DIV><FONT size=2>More1:</FONT></DIV>
<DIV><FONT size=2>-Using Variables to Enhance and Simplify (p.209
MSKv65-man.)</FONT></DIV>
<DIV><FONT size=2>-Naming of Variables (p.209-210 MSKv65-man.)<BR>-Using
Variables to Represent Numbers (p.210 MSKv65-man.)</FONT></DIV>
<DIV><FONT size=2>-Using <EM><U>pre-set</U></EM> Variables to Represent
Numbers (Numerical Constants) (MSK Formula FAQ's + Tips Part 1).</FONT></DIV>
<DIV>
<DIV>
<DIV><FONT size=2>-Using <EM><U>calculated</U></EM> Variables to Represent
Numbers (Numerical Constants) (MSK Formula FAQ's + Tips Part
2).</FONT></DIV></DIV>
<DIV><FONT size=2>-Using Variables to Represent Mathematical Expressions
(p.210-212 MSKv65-man.)<BR>-Referencing Variables within Custom Indicators
(p.212 MSKv65-man.)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>More2:</FONT></DIV>
<DIV><FONT size=2>-From the Glossary (p.212
MSKv65-man.)</FONT></DIV></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>More3:</FONT></DIV>
<DIV><FONT size=2>-From the in MSK available Functions (p231-232
MSKv65-man.)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><FONT
size=2>--------------------------------------------------------------</FONT></FONT></DIV>
<DIV><FONT size=2>More1:</FONT></DIV>
<DIV><FONT size=2><FONT
size=2>--------------------------------------------------------------</FONT></FONT></DIV>
<DIV> </DIV>
<DIV></FONT><STRONG><U><FONT size=3>Using Variables to Enhance and
Simplify</FONT></DIV></DIV></DIV></DIV></U></STRONG>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>In order to shorten, simplify, enhance, and make the
maintenance of complex formulas easier, you may want to use
variables.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG><U>Variable</U></STRONG></FONT></DIV>
<DIV><FONT size=2>1.- A variable is an alphanumeric name (up to 20 characters)
that is assigned to an expression or a single value.</FONT></DIV>
<DIV><FONT size=2>2.- Up to 20 variables can be used in a formula.</FONT></DIV>
<DIV><FONT size=2>3.- Variables must be assigned before the variable is used in
the formula.</FONT></DIV>
<DIV><FONT size=2>4.- A semi-colon must be used at the end of the variable
assignment line.</FONT></DIV>
<DIV><FONT size=2>5.- Variables cannot be assigned within a
function.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><STRONG><U><FONT size=3>Naming of Variables</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>The following rules apply to the naming of
variables:</FONT></DIV>
<DIV><FONT size=2><STRONG>· </STRONG>Variable names cannot contain commas,
parenthesis, spaces, underscores, etc. <BR><STRONG>· </STRONG>Variable
names cannot duplicate names already used by functions (e.g., mov, rsi, cci, if,
etc.). <BR><STRONG>· </STRONG>A variable cannot be assigned a name
that matches the parameters reserved for use in formulas (e.g., open, high, low,
close, simple, o, c, l, h, s, e, w, etc.). </FONT></DIV>
<DIV><FONT size=2> The following would produce an error, since the letter
"s" is reserved for the moving average function, mov(), to mean
"simple."</FONT></DIV>
<DIV><FONT size=3>s:= (h+l+c)/3;</FONT></DIV>
<DIV><FONT size=2><FONT size=2><FONT size=2><FONT
size=2><STRONG>· </STRONG>Variable </FONT></FONT></FONT>names must contain
at least one alpha letter (e.g., T1234 ).</FONT></DIV>
<DIV><FONT size=2><STRONG>· </STRONG>Variable names are not case sensitive
(e.g., "PERIODS" is the same as "periods").</FONT></DIV>
<DIV> </DIV>
<DIV><STRONG><U><FONT size=3>Using <EM>pre-set </EM>Variables to Represent
Numbers (Numerical Constants) (Part 1)</FONT></U></STRONG></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2><STRONG><U>Operators</U></STRONG></FONT></DIV>
<DIV><FONT size=2>Being part of the Set of Operators used in
MetaStock:</FONT></DIV>
<DIV><FONT size=2>
-Mathematical</FONT></DIV>
<DIV><FONT size=2> -Logical
Condition</FONT></DIV>
<DIV><FONT size=2> -Variable
Assigned</FONT></DIV>
<DIV><FONT size=2>the <STRONG>Variable Assignment Operator (VA) </STRONG>is
written in a Formula as follows:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG>:= </STRONG>{the <STRONG>Variable Assignment
Operator</STRONG>}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG><U>Variable Assigning</U></STRONG></FONT></DIV>
<DIV><FONT size=2>Suppose you would like to be able to quickly adjust the time
periods throughout a formula without having to edit each use of the time periods
individually.</FONT></DIV>
<DIV><FONT size=2>This could be easy accomplished by <STRONG><EM>assigning
</EM></STRONG>the Time periods (as a Numeric Value) to a
<STRONG>Variable</STRONG>, </FONT><FONT size=2>for example to a
<STRONG>Variable </STRONG>named "periods", as in:<BR></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=3>periods := 10;</FONT></DIV>
<DIV><FONT size=3>c > mov(c,periods, s) and ref(c,-1) >
ref(mov(c,periods,s),-1) and</FONT></DIV>
<DIV><FONT size=3>h > mov(h,periods,s) and ref(h,-1) >
ref(mov(h,periods,s),-1)</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>-In the above formula, the number "10" will be the substitute
value of "periods" wherever the <STRONG>Variable </STRONG>named
"periods" appears in the formula.</FONT></DIV>
<DIV><FONT size=2>-When you want to adjust the time periods in this formula,
simply change the <STRONG>Number <EM>assigned </EM></STRONG>to the "periods"
<STRONG>Variable</STRONG>.</FONT></DIV>
<DIV><FONT size=2>-If you change "10" to "20," the number "20" will be the
substitute value for "10" throughout the formula. </DIV></FONT>
<DIV><FONT size=2>-</FONT><FONT size=2>Of course, you could also
<STRONG><EM>assign </EM></STRONG>multiple <STRONG>Variables </STRONG>to
represent multiple <STRONG>Numbers </STRONG>as follows:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=3>periods1 := 10;<BR>periods2 := 20;<BR>c > mov(c,periods1,
s) and ref(c,-1) > ref(mov(c,periods1,s),-1) and</FONT></DIV>
<DIV><FONT size=3>h > mov(h,periods2,s) and ref(h,-1) >
ref(mov(h,periods2,s),-1)</FONT></DIV>
<DIV><FONT size=3></FONT> </DIV>
<DIV><FONT size=2>-In this case, the <STRONG>Variables</STRONG> "periods1" and
"periods2" represent two different values that can be used as many times as
desired throughout the formula.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT
size=2>--------------------------------------------------------------</FONT></FONT></DIV>
<DIV><FONT size=2>More2:</FONT></DIV>
<DIV><FONT size=2>-From the Glossary (p.212 MSKv65-man.)</FONT></DIV>
<DIV><FONT
size=2>--------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><U><STRONG>NUMERIC CONSTANT:</STRONG></U></FONT></DIV>
<DIV><FONT size=2>A single numeric value. A function requiring a numeric
constant cannot accept a data array since a data array may contain multiple,
rather than single, numeric values. An example of a numeric constant is
the "10" in the formula "mov(C,10,E)."</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><U><STRONG>FUNCTION RESULT ARRAY:</STRONG></U></FONT></DIV>
<DIV><FONT size=2>A <EM>data array </EM>that is <STRONG>created </STRONG><EM>as
the result (</EM>thus as a Data Array value) <STRONG>of the execution
(=calculation) </STRONG><EM>of a function</EM>.<BR></FONT></DIV>
<DIV><FONT size=2><STRONG><U></U></STRONG></FONT> </DIV>
<DIV><FONT size=2><STRONG><U>LITERAL ARRAY:</U></STRONG></FONT></DIV>
<DIV><FONT size=2>A <EM>data array </EM>that is <STRONG>defined </STRONG>using a
single Numeric Constant (eg "10").</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT size=2><FONT
size=2>--------------------------------------------------------------</FONT></FONT></FONT></DIV>
<DIV><FONT size=2>More3:</FONT></DIV>
<DIV><FONT size=2>-From the in MSK available Functions (p231-232 MSKv65-man.)
</FONT></DIV>
<DIV><FONT
size=2>--------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG><U>FUNCTION</U></STRONG> lastvalue(DATA
ARRAY)<BR></FONT></DIV>
<DIV><FONT size=2>The LAST VALUE function <EM><U>loads</U></EM>
<STRONG>only </STRONG>an:</FONT></DIV>
<DIV><FONT size=2>"entire data array" with the last known calculated value of
the specified DATA ARRAY". </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Interpretation</FONT></DIV>
<DIV><FONT size=2><STRONG>-</STRONG>Fuction loads only {the DATA ARRAY} (and
thus oppose to the FRA or LA functions, which are either</FONT></DIV>
<DIV><FONT size=2> created </FONT><FONT size=2>as the <EM>result
</EM>of </FONT><FONT size=2>calculations(FRA)</FONT><FONT size=2> or
<EM>pre-efined </EM>upfront(LA), it uses the <EM>actual </EM></FONT><FONT
size=2>entire</FONT></DIV>
<DIV><FONT size=2> DATA ARRAY's array data (which could also well be C, for
example).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-And just loads the passed on array data as
a <U><EM>Constant</EM></U> (thus like done in the Literal
Array)</DIV></FONT>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-With the last known (thus once loaded = not changable)
"calculated value" (thus the Fuction Result data array)</FONT></DIV>
<DIV><FONT size=2> of the specified DATA ARRAY (thus the 'dynamicaly'
<U><EM>calculated results </EM></U>of Function).</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>-The result of this function can thus be used <STRONG>in place
of </STRONG>a Numeric <STRONG>constant </STRONG>(eg "10") in any function
<EM>argument</EM>.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></FONT>
<DIV><FONT size=2>-And where a Price Array can be a Data Array, but vice versa,
where a Data Array can -among many other arrays- be a Price Array, but
where this need NOT BE the standard all of the time.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=3>Regards,<BR>Ton Maas<BR><A
href="mailto:ms-irb@xxxxxxxxxxxxxxxx">ms-irb@xxxxxxxxxxxxxxxx</A><BR>Dismiss the
".nospam" bit (including the dot) when replying.<BR>Homepage <A
href="http://home.planet.nl/~anthmaas">http://home.planet.nl/~anthmaas</A></FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
Michael Spencer </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=metastock@xxxxxxxxxxxxx
href="mailto:metastock@xxxxxxxxxxxxx">metastock@xxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> woensdag 19 april 2000 9:07</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: A Round about way for Date
Function</DIV>
<DIV><BR></DIV>
<DIV><FONT color=#000000 size=2>Andrew ... I believe that a value can be
passed into HHV using the LastValue function. Try
HHV(H,lastvalue(array)), where "array" is the value you want to pass in.
Metastock should have some sort of app note on this, as I have asked them and
received a no-can-do reply. But they don't, I think.
However, I am using this method in custom indicators; and, if you look in the
manual (V6.52, p.235), you'll see that the Last Value function is specifically
identified for passing constants into functions, supposedly like HHV.
You shouldn't have any problem, but give me a holler if you need
help.</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT> </DIV>
<DIV><FONT size=2>Best regards,</FONT></DIV>
<DIV><FONT size=2>Michael Spencer</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><B>-----Original Message-----</B><BR><B>From: </B>Kornberg
Family<BR><B>To: </B>Metastock List <<A
href="mailto:metastock@xxxxxxxxxxxxx">metastock@xxxxxxxxxxxxx</A>><BR><B>Date:
</B>Tuesday, April 18, 2000 5:13 AM<BR><B>Subject: </B>A Round about way for
Date Function<BR><BR></DIV>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid"></FONT>
<DIV><FONT size=2><SPAN class=10140112-18042000>Hi,</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Metastock still does not
have a date function. I have a workaround but unfortunately some of
the other Metastock functions eg. HHV cannot use a passed
number.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Here is a Days in trade
plot.</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Days in
Trade</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Day1 := Input("Day of
Trade",1,31,4);<BR>Month1 := Input("Month of Trade",1,12,1);<BR>Year1 :=
Input("Year of Trade",1900,2400,2000);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><SPAN
class=10140112-18042000>PdsTrade:=BarsSince(DayOfMonth()=Day1 AND Month()=
Month1 AND Year()= Year1);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><SPAN
class=10140112-18042000>PdsTrade;</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>I would like to be able to
pass the number of days into HHV but it does not allow me to
do this. I want to do the following:</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>HHVStop:=
HHV(H,PDSTrade) ;</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Can anyone suggest a
workaround?</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000></SPAN></FONT> </DIV>
<DIV><FONT size=2><SPAN class=10140112-18042000>Thanks,</SPAN></FONT></DIV>
<DIV><FONT size=2><SPAN
class=10140112-18042000><BR>Andrew</SPAN></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></FONT></DIV></BODY></HTML>
</x-html>
|