PureBytes Links
Trading Reference Links
|
<x-html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content=Word.Document name=ProgId>
<META content="MSHTML 5.50.3825.1300" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="cid:filelist.xml@xxxxxxxxxxxxxxxxx" rel=File-List><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:Zoom>0</w:Zoom>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:ForgetLastTabAlignment/>
<w:DoNotUseHTMLParagraphAutoSpacing/>
</w:Compatibility>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
font-family: Wingdings;
}
@font-face {
font-family: Tahoma;
}
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
P.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
LI.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
DIV.MsoAutoSig {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
SPAN.EmailStyle18 {
COLOR: navy; mso-style-type: personal; mso-ansi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
SPAN.EmailStyle21 {
COLOR: #993366; mso-style-type: personal-reply; mso-ansi-font-size: 10.0pt; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US style="tab-interval: .5in" vLink=blue link=blue bgColor=white>
<DIV><FONT size=2>TOPIC : How to convert PREV over to Ref() {or how to
replace the PREV by the Ref() Function}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>1. -below find your original COMOUP var code {organized and
now with indicator}</FONT></DIV>
<DIV><FONT size=2>2. -below also find an unraffled version for use as an
example</FONT></DIV>
<DIV><FONT size=2>3. -the remake of the example explained</FONT></DIV>
<DIV><FONT size=2>4. -the remake of the example</FONT></DIV>
<DIV><FONT size=2>5. -the instructions to calculate PREV in Excel</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Will let you continue to do the conversion of your own
indicators, since it will take up some time......</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Note for 1+2</FONT></DIV>
<DIV><FONT size=2>For the purpose of the example, all your FmlVar functions were
replaced by surrogate(simulated) values,</FONT></DIV>
<DIV><FONT size=2>e.g. </FONT><FONT size=2>-since that
they represent a valid value {basically, they could have been "indicators" or
"variables"}</FONT></DIV>
<DIV><FONT size=2>
-</FONT><FONT size=2>since that they can have easely been a certain day's
value from a (part of) calculation result.</FONT><FONT size=2></DIV></FONT>
<DIV><FONT size=2></FONT><BR>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></DIV>
<DIV><FONT size=2><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT
size=2>==================================================================</FONT></FONT></DIV>
<DIV><FONT size=2><STRONG></STRONG></FONT> </DIV>
<DIV><FONT size=2><STRONG>1. Original
Formula</STRONG><BR>-------------------------------<BR>COMOUP1:= <FONT
color=#ff0000>If(
</FONT>FmlVar("COM-BASIC1","COMMNUMB")=0,<BR>
(Mov(FmlVar("COM-BASIC1","COMMNUMB"),21,S)/
21),<BR> <FONT
color=#0000ff>If(
</FONT>FmlVar("COM-BASIC1","COMCBAR")>0,<BR>
((PREV*20)+
FmlVar("COM-BASIC1","COMMNUMB"))/20,<BR>
(PREV*20)/21<BR>
<FONT
color=#0000ff>)</FONT><BR> <FONT
color=#ff0000>)</FONT><FONT color=#000000>;<BR>COMOUP1<![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><!--[if supportFields]><span class=EmailStyle21><font
size=2 color="#993366" face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Arial'><span style='mso-element:field-begin'></span><span
style="mso-spacerun: yes"> </span>AUTOTEXTLIST \s "E-mail
Signature" <span style='mso-element:field-separator'></span></span></font></span><![endif]--><![if !supportEmptyParas]><![endif]><!--[if supportFields]><span class=EmailStyle21><font
size=2 color="#993366" face=Arial><span style='font-size:10.0pt;mso-bidi-font-size:
12.0pt;font-family:Arial'><span style='mso-element:field-end'></span></span></font></span><![endif]--><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><![if !supportEmptyParas]><![endif]><!--[if supportFields]><span
class=EmailStyle18><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><span style='mso-element:
field-begin'></span><span style="mso-spacerun: yes"> </span>AUTOTEXTLIST
\s "E-mail Signature" <span style='mso-element:field-separator'></span></span></font></span><![endif]--><!--[if supportFields]><span
class=EmailStyle18><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;mso-bidi-font-size:12.0pt;font-family:Arial'><span style='mso-element:
field-end'></span></span></font></span><![endif]--></FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>==================================================================</FONT></DIV>
<DIV><FONT size=2><FONT color=#008080></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT color=#008080><STRONG><FONT color=#000000>2.
</FONT></STRONG><EM>PREV Formula Code </EM></FONT>(<STRONG>Original Formula
</STRONG>above, now broken down for
an <STRONG>example</STRONG>)<BR>-----------------------------------------------------------------------------------------------------------------------------<BR>MYVAR:=
<FONT color=#ff0000>If(
</FONT>2=0,
{=never
true}<BR>
(2*21)/21,
{then=not
used}<BR>
<FONT color=#0000ff>If(
</FONT>1>0,
{else=ok, and true=ok
too}<BR>
<FONT color=#800000>((PREV*20)+2)/20</FONT>, {THEN=THE
PART BEING
USED}<BR>
(PREV*20)/21
{else=not
used}<BR>
<FONT
color=#0000ff>) </FONT>
{close
if-function} <BR> <FONT
color=#ff0000>)</FONT>;
{close
if-function}<BR>MYVAR
{command to calculate variable}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>==================================================================</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG>3. </STRONG>Explanation of <EM><FONT
color=#800080>Ref() Formula Code </FONT></EM>below
<BR>---------------------------------------------------------------<BR>FirstDay:=
2/20;
{var=calculating 1st period's value}<BR>NextDay:=
((FirstDay*20)+2)/20;
{var=is PREV, the Function, now here
calculating</FONT></DIV>
<DIV><FONT
size=2>
the "THEN=THE PART BEING USED" on</FONT></DIV>
<DIV><FONT
size=2>
the 4th line </FONT><FONT size=2>in <STRONG>example
</STRONG>above}</DIV></FONT>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT
size=2>==================================================================</FONT></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><FONT color=#800080><STRONG><FONT color=#000000>4.
</FONT></STRONG><EM>Ref() Formula Code </EM></FONT>( <FONT color=#008080
size=2><EM>PREV Formula Code </EM></FONT>above, but now PREV replaced by
Ref-Function)<BR>-------------------------------------------------------------------------------------------------------------------------------------<BR>FirstDay:=
2/20;
{var=calculating 1st period's value}<BR>NextDay:=
((FirstDay*20)+2)/20;
{var=is PREV, the Function, now here...}<BR>MYVAR:= <FONT color=#ff0000>If(
</FONT>2=0,
{=never
true}<BR>
(2*21)/21,
{then=not
used}<BR>
<FONT color=#0000ff>If(
</FONT>1>0,
{else=ok, and true=ok
too}<BR>
<FONT color=#800000>((NextDay*20)+2)/20</FONT>, {THEN=THE PART BEING
USED}<BR>
(NextDay*20)/21 {else=not
used}<BR> <FONT
color=#0000ff>)</FONT> {close
if-function}
<BR>
<FONT
color=#ff0000>)</FONT>; {close
if-function}<BR>MYVAR
{command to calculate variable}</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>==================================================================</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2><STRONG>5. </STRONG>Excel Formulas+instructions</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>In MSK</FONT></DIV>
<DIV><FONT size=2>- create+plot the above custom indicators 2 + 4 on a
Chart {use a Sec with 1/2 year of Data}</FONT></DIV>
<DIV><FONT size=2>- rightclick both indicators and click Copy</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>In Excel</FONT></DIV>
<DIV><FONT size=2>- select cell A1</FONT></DIV>
<DIV><FONT size=2>- paste both custom indicators </FONT><FONT
size=2>{check column headers A=Date, B=ind2 , C=Date
, D=ind4}</FONT></DIV>
<DIV><FONT size=2>- select cell E1 and type TestGUY'sVAR"</FONT></DIV>
<DIV><FONT size=2>- select cell E2 and type =2/20</FONT></DIV>
<DIV><FONT size=2>- select cell E3 and type =(($E2*20)+2)/20</FONT></DIV>
<DIV><FONT size=2>- while cell E3 is selected, doubleclick the tiny black
square handle to fill down the E column</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If all went well</FONT><FONT size=2>, then
find the 3 indicators (</FONT><FONT size=2>MetaStock's PREV and Ref()
Functions and Excel)</FONT></DIV>
<DIV><FONT size=2>all in agreement, something like printed below and are
thus all also calculculating correctly.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
<TABLE cellSpacing=0 cellPadding=2 width=447 border=0>
<TBODY>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=left>Date</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=left> testVAR (PREV)</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=left> Date</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=left> testVAR (Ref())</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=left> testVAR (XLS)</FONT></P></TD></TR>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840716</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.1</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840716</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.1</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.1</FONT></P></TD></TR>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840717</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.2</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840717</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.2</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.2</FONT></P></TD></TR>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840718</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.3</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840718</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.3</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.3</FONT></P></TD></TR>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840719</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.4</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840719</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.4</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.4</FONT></P></TD></TR>
<TR>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840720</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.5</FONT></P></TD>
<TD width="15%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>19840720</FONT></P></TD>
<TD width="24%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.5</FONT></P></TD>
<TD width="21%" height=16><FONT face=Arial color=#000000 size=2>
<P align=right>0.5</FONT></P></TD></TR></TBODY></TABLE></DIV></FONT>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Conversion completed.</FONT></DIV>
<DIV><FONT size=2><FONT
size=2>==================================================================</FONT></FONT></DIV></BODY></HTML>
</x-html>
|