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

Re: Calculation question again



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 bgColor=#ffffff>
<DIV><FONT size=2>
<DIV><FONT size=2><FONT size=2>COMHCRXX:= FmlVar("COM-CNTRY","COMCR"); 
</FONT></FONT></DIV></FONT></DIV>
<DIV><FONT size=2>COMHCRR:= If(</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT 
size=2><FONT size=2>COMHCRXX </FONT></FONT>&gt; 0 ,</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(PREV) 
+ 1 ,</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If(</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;Ref( COMHCRT , -1 ) - 1 ,</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Ref( COMHCRT , -1 )</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
)</FONT></DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
);</FONT></DIV>
<DIV><FONT size=2>COMHCRR;</FONT></DIV>
<DIV><FONT size=2>COMHCRT2</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Adjustments were made...just from eyeballing. </FONT></DIV>
<DIV><FONT size=2>Will take up a closer look + more time, to see and test it for 
it to be correct,</FONT></DIV>
<DIV><FONT size=2>hope you will get the drift tho,&nbsp;from the alterations 
that were&nbsp;made.</FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>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&nbsp; </FONT><A 
href="http://home.planet.nl/~anthmaas";><FONT 
size=2>http://home.planet.nl/~anthmaas</FONT></A></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2><FONT 
size=2><A>////////////////////============//////////////////////</A></FONT></FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2>&nbsp;</DIV></FONT>
<DIV><FONT size=2>----- Original Message ----- </FONT>
<DIV><FONT size=2>From: "Guy Tann" &lt;</FONT><A 
href="mailto:grt@xxxxxxxxxxxx";><FONT size=2>grt@xxxxxxxxxxxx</FONT></A><FONT 
size=2>&gt;</FONT></DIV>
<DIV><FONT size=2>To: "Metastock User Group" &lt;</FONT><A 
href="mailto:metastock-list@xxxxxxxxxxxxx";><FONT 
size=2>metastock-list@xxxxxxxxxxxxx</FONT></A><FONT size=2>&gt;</FONT></DIV>
<DIV><FONT size=2>Sent: woensdag 16 augustus 2000 18:50</FONT></DIV>
<DIV><FONT size=2>Subject: Calculation question again</FONT></DIV></DIV>
<DIV><FONT size=2><BR></FONT></DIV><FONT size=2>&gt; List,<BR>&gt; <BR>&gt; 
Well, I'm still trying to move our Intermediate Term Signals into MS and 
I'm<BR>&gt; still having problems.&nbsp; I have completed all of the coding and 
am now in the<BR>&gt; debugging stage.<BR>&gt; <BR>&gt; First, here are two 
calculations that I've tried.&nbsp; One works (the one with<BR>&gt; PREV) and 
one doesn't.&nbsp; After all of the help the last time around, I<BR>&gt; 
naturally tried the Ref() function because everyone said it was the<BR>&gt; 
preferable approach.<BR>&gt; <BR>&gt; Any and all help is appreciated.<BR>&gt; 
<BR>&gt; COMHCRR:= If( FmlVar("COM-CNTRY","COMCR") &gt; 0 , PREV + 1 , 
If(<BR>&gt; FmlVar("COM-CNTRY","COMCR") &lt; 0 , PREV - 1 , PREV ) );<BR>&gt; 
COMHCRR;<BR>&gt; <BR>&gt; COMHCRT:= If(&nbsp; FmlVar("COM-CNTRY","COMCR") &gt; 0 
, Ref( COMHCRT, -1 ) + 1 ,<BR>&gt; If(&nbsp; FmlVar("COM-CNTRY","COMCR") &lt; 0 
, Ref( COMHCRT , -1 ) - 1 , Ref(<BR>&gt; COMHCRT , -1 ) ) );<BR>&gt; 
COMHCRT;<BR>&gt; <BR>&gt; This is a simple calculation where I accumulate a 
total, adding 1 if the<BR>&gt; indicator&nbsp; &gt; 0, subtracting 1 if it is 
&lt; 0 and just carrying the previous<BR>&gt; day's value forward if there is no 
change.&nbsp; Nothing sophisticated.<BR>&gt; <BR>&gt; My second minor problem is 
that the answer is incorrect.&nbsp; I've exported my<BR>&gt; MS SPI data into a 
Clipper database to insure an identical test data set.<BR>&gt; Based upon that, 
the results should be identical, especially since this<BR>&gt; calculation is so 
simple.&nbsp; I haven't double-checked that COMCR calculation<BR>&gt; in both 
systems, but I will right now.&nbsp; I should say that I had verified<BR>&gt; 
that calculation before but I will do it again just to make sure nothing<BR>&gt; 
else managed to get screwed up.<BR>&gt; <BR>&gt; Guy<BR>&gt; <BR>&gt; Never be 
afraid to try something new. Remember, amateurs built the ark,<BR>&gt; 
professionals built the Titanic.<BR>&gt; <BR>&gt; <BR>&gt; </FONT></BODY></HTML>

</x-html>