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

Re: System tests referencing a second security



PureBytes Links

Trading Reference Links

<x-html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2014.210" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2>See, to a simular question, my&nbsp;reply + Equis Supports' 
reply and the Equis' webpages below.</FONT></DIV>
<DIV><FONT size=2><FONT size=2><FONT size=2>In the Equis' RS webpage&nbsp;read 
for the Scanner(Explorer) as </FONT></FONT><FONT size=2><FONT size=2>the Sytem 
Tester.</FONT></FONT></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Scans(Explorations) and System Tests usually use the current 
Active Chart, eg the Chart that</FONT></DIV>
<DIV><FONT size=2>is </FONT><FONT size=2>currently Open and has </FONT><FONT 
size=2>its (upper top) Window Title Bar being colored 
Blue(=highlighted),</FONT></DIV>
<DIV><FONT size=2>upose to Grey(=inactive). </FONT><FONT size=2>Otherwise, if no 
Chart is currently Open (eg a clean MetaStock Window),</FONT></DIV>
<DIV><FONT size=2>then a </FONT><FONT size=2>Multiple Folder/Security Choise 
</FONT><FONT size=2>Menu+List will be presented to choose (any of) the to 
be</FONT></DIV>
<DIV><FONT size=2>scanned or </FONT><FONT size=2>tested&nbsp;security(ies) from, 
when running the Scanner </FONT><FONT size=2>or SystemTester.</FONT></DIV>
<DIV><FONT size=2>This is the important detail to know, when using the "P" 
indicator, eg when it is included in</FONT></DIV>
<DIV><FONT size=2>a&nbsp;formula.</FONT><FONT size=2></DIV></FONT>
<DIV><FONT size=2>Also from the MS65-Manual(p.285) note the same "everyday" 
formula usage applies:</FONT></DIV>
<DIV><FONT size=2>"System trading rules use the same SYNTAX as custom 
indicators.</FONT></DIV>
<DIV><FONT size=2>(for the MetaStock Formula Language, see p. 
201)."</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>As to your formula's Ratio-formula(s), there are several 
options to choose from:</FONT></DIV>
<DIV><FONT size=2>the Relatiave Strength (RS),&nbsp;</FONT><FONT size=2>the Rate 
of Change (ROC),&nbsp;</FONT><FONT size=2>the Divergence (DIV),</FONT></DIV>
<DIV><FONT size=2>the Correlation (COR) or the Performance (PER).</FONT></DIV>
<DIV><FONT size=2>&nbsp;</FONT></DIV>
<DIV><FONT size=2>Regards,<BR>Ton Maas<BR><A 
href="mailto:ms-irb@xxxxxx";>ms-irb@xxxxxx</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>============================================</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Divergence between the Close and an Indicator</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Rev. 03/18/97</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>The following formula will calculate the correlation of the 
Close and the MACD. It is written using a "long form" MACD<BR>so that the time 
periods used by the MACD may be changed. This indicator shows "divergence" 
between the close and the indicator:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;In the Windows versions of MetaStock the formula 
is:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT 
size=2>Correl(((Sum(Cum(1)*(Mov(C,12,E)-Mov(C,26,E)),100))-(Sum(Cum(1),100)*<BR>Sum((Mov(C,12,E)-Mov(C,26,E)),100)/100))/((Sum(Power(Cum(1),2),100))-<BR>(Power(Sum(Cum(1),100),2)/100)),((Sum(Cum(1)*C,100))-(Sum(Cum(1),100)*<BR>Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))-(Power(Sum(Cum(1),100),2)/100)),12,0)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>The interpretation of the indicator output is as follows:<BR>- 
.08 (80%) and lower is divergence between the Close and the MACD.<BR>- 1 is very 
strong divergence.<BR>+ 1 is very strong correlation.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>The formula was constructed this way so that most other 
indicators may be used in place of the MACD.<BR>For example here is the same 
indicator using the RSI(14):</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT 
size=2>Correl(((Sum(Cum(1)*(RSI(14)),100))-(Sum(Cum(1),100)*<BR>Sum((RSI(14)),100)/100))/((Sum(Power(Cum(1),2),100))-(Power(Sum(Cum(1),100),2)/100)),<BR>((Sum(Cum(1)*C,100))-(Sum(Cum(1),100)*Sum(C,100)/100))/((Sum(Power(Cum(1),2),100))-<BR>(Power(Sum(Cum(1),100),2)/100)),12,0)</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>============================================<BR>----- Original 
Message ----- <BR>From: A.J. Maas &lt;<A 
href="mailto:anthmaas@xxxxxx";>anthmaas@xxxxxx</A>&gt;<BR>To: &lt;<A 
href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx</A>&gt;<BR>Sent: 
woensdag 11 november 1998 22:56<BR>Subject: Re: system testing<BR><BR>I refer 
you to previous mail(Oct98) send to the List which had as subject<BR>"Re: 
GEN/MKT: What is this called?"<BR>with more explainations and instructions, eg 
using the " P " variable<BR>as an indicator or formula, and also as you can use 
more other<BR>indicators too, such as:<BR>-Correlation<BR>-Relative 
Strength<BR>-Divergence<BR>-Performance<BR>-Rate of 
Change<BR>etc.<BR>-----------------------------<BR>"P" as indicator (MS65 manual 
p.213)<BR><BR>Have them compare "your secs" against the "index" using the "P" 
operator/indicator.<BR>By using the " P " indicator, eg as a custom formula 
"P/C" , you are able to compare<BR>base sec versus any sec (P/C&nbsp; = a 
Relative Strength Comparative Ratio Comparison).<BR>Using the "P" variable 
ALWAYS represents the charts' plot where its dropped on, eg<BR>this can be the 
Base sec itselve as well as an indicator plotted in any of the<BR>MAIN windows 
inner windows.<BR><BR>When plotting, it will always represent an already on a 
chart plotted but now highlighted<BR>(=selected) indicator when dragged + 
dropped down on a chart/inner window from<BR>the Indicator 
QuickList.<BR><BR>Examples:<BR><BR>To CREATE CUSTOM indicator usable in Charts, 
Layouts, Templates, Explorer,<BR>&nbsp;System Tester and in Expert 
Advisor<BR><BR>-Start Metastock<BR>-Click the Indicator Builder button<BR>-Click 
"New"<BR>-In the Name Field type SPX-P indicator<BR>-In the Formula Field type 
P/C<BR>&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
P=Base Close 
Present<BR>&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
C=Base Close Original<BR>-Click OK<BR><BR>To create Chart/Template/Layout 
:<BR><BR>-Open the SPX chart<BR>-After opening the SPX-chart drag the selve made 
"SPX-P" indicator down from<BR>&nbsp;&nbsp;&nbsp; the IQL and 'release' it in 
its own inner window(it will now calculate on the CLOSE<BR>&nbsp;&nbsp;&nbsp; 
from its own chartbase, the SPX, AND also the Base sec's CLOSE of the 
SPX<BR>&nbsp;&nbsp;&nbsp; as it is then representing the present&nbsp; "P" part 
of the indicator<BR>-Open the chart of the FTSE<BR>-Click on one of the Display 
Adjusting Tools, eg the "Column" button, to have the<BR>&nbsp;&nbsp;&nbsp; 
charts orderly displayed side by side on the screen<BR>-From the SPX chart Drag 
the just made "SPX-P" indicator onto the FTSE chart<BR>&nbsp;&nbsp;&nbsp; and 
release to have it being displayed in its inner window and it will now 
calculate<BR>&nbsp;&nbsp;&nbsp; on the FTSE as Base)<BR>-Click the New | Layout 
button (here you can also choose Template)<BR>-Click Add All (this will add both 
charts)<BR>-Click OK (from this point on you are able to File | Save As to any 
folder as 
either<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
a Template or as a Layout, whatever your preference)<BR><BR>The program will now 
calculate, plot and create an always re-usable Layout of the<BR>FTSE/SPX 
comparison, eg Create a shortcut from this Layout onto 
your<BR>Desktop/Toolbars.<BR>If you have saved the above as a Template then you 
can compare any security against<BR>the SPX.<BR><BR>To run all the above as a 
System Test, you will have to create a System Test first using<BR>the above 
given formula, but most importantly, see the MS manual(p.213-287) :<BR>"You MUST 
have a Layout or a Templated Chart open &amp; active running before<BR>any " P " 
System Tests or " P " Explorations can be made".<BR><BR></FONT><FONT 
size=2>============================================</FONT></DIV>
<DIV><FONT size=2>You would plot the mov formula on security one and then drag 
it into the<BR>chart of security two.&nbsp; Select it and in the custom formula 
use<BR>P-mov(ROC(C,1,%), 25, E).<BR>The selected plot is P.&nbsp; You can 
continue to drag plots into other<BR>charts to continue this indicator and save 
it as a chart and then open<BR>the chart. The chart will recalculate the 
indicator.<BR><BR>There is an FAQ on our web site outlining how to make your own 
index.<BR>The same principle applies.<BR><BR>Equis Support<BR><A 
href="http://www.equis.com/";>http://www.equis.com/</A><BR><A 
href="http://www.equis.com/customer/support/";>http://www.equis.com/customer/support/</A><BR>Please 
include previous email answers and questions in your response. <BR><BR>Equis and 
MetaStock and MetaStock Professional are registered trademarks<BR>of Equis 
International.&nbsp; Achelis Binary Wave, The DownLoader, Expert<BR>Advisor, 
OptionScope, Quotecenter, and Smart Charts are trademarks of<BR>Equis 
International.<BR><BR><BR><BR>-----Original Message-----<BR>From: Tim Gadd 
&lt;timgadd@xxxxxxxxxxx&gt;<BR>To: <A 
href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx</A> &lt;<A 
href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx</A>&gt;<BR>Date: 
Monday, February 08, 1999 7:34 PM<BR>Subject: Referencing Multiple Securities in 
Custom Indicators<BR><BR><BR>&gt;Is it possible to build a custom indicator 
that, for instance,<BR>subtracts<BR>&gt;a moving average of the price rate of 
change of one security from the<BR>&gt;moving average of the price rate of 
change of another security?<BR>&gt;<BR>&gt;mov(ROC(C,1,%), 25, E) for 
sec1<BR>&gt;minus<BR>&gt;mov(ROC(C,1,%), 25, E) for sec2<BR>&gt;<BR>&gt;Surely 
there is a way, but I can't figure it out. Any help 
appreciated.<BR>&gt;<BR>&gt;______________________________________________________<BR>&gt;Get 
Your Private, Free Email at <A 
href="http://www.hotmail.com";>http://www.hotmail.com</A><BR>&gt;<BR></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>============================================</FONT></DIV>
<DIV><FONT size=2>
<P><FONT size=5>Comparative Relative Strength in MetaStock&#8482; for Windows </FONT>
<P><FONT size=1>rev. 01/06/97<BR></FONT>
<P>Comparative Relative Strength charts can be useful in deciding which security 
to buy, by helping to pinpoint the best performer. They can also be useful in 
developing spreads, i.e., purchase of the best performer "long", and selling the 
weaker issues "short." Comparative Relative Strength can be applied in MetaStock 
for Windows as follows:<BR><BR><B>Creation of a Template for Comparative 
Relative Strength<BR></B>
<P>(For this illustration, we assume an equity/stock is compared to the S&amp;P 
500, both of which must first have been collected from your vendor. Both data 
files should be in the same periodicity.) <BR>
<OL>
  <LI>Load the S&amp;P 500. 
  <LI>Load the equity, or whatever you wish to find the relative strength for. 
  <LI>Drag the S&amp;P 500 plot into a new inner window of the equity. (You may 
  need to click Stack first.) 
  <LI>Close the S&amp;P 500 chart. 
  <LI>Create a custom indicator: Div(close, p) 
  <LI>Drag the custom indicator into the inner window containing the S&amp;P 500 
  plot, moving it over the plot until the plot changes to a pink or lavender 
  color, then release your mouse button. (This is called dragging and dropping 
  an indicator on an indicator. The new indicator will plot in the same window 
  as the S&amp;P 500 plot.) You have two options here: 
  <UL>
    <LI>You can change the color of the S&amp;P 500 plot to be the same as the 
    chart background color, so that it is effectively invisible. (Double-click 
    the S&amp;P 500 plot to get to its "properties", then choose the color you 
    need from the Colors list.)<BR>
    <LI>You can give both plots different colors so you can tell which is 
    which.<BR></LI></UL>
  <LI>Save this chart as a Template. (File|Save As, set "Save File As Type" to 
  Template, and give it a name, such as CMPRELST.MWT.) <BR></LI></OL>
<P>Any time you want to see Comparative Relative Strength of an equity against 
the S&amp;P 500, apply this template to the equity's chart. Note: if you should 
move the data file against which you are comparing, such as the S&amp;P 500, 
this template will no longer work, and would have to be 
recreated.<BR><BR><BR><B>To Run an Exploration Using Comparative Relative 
Strength<BR></B>
<OL>
  <LI>Load the S&amp;P 500 (or whatever you want to compare against). 
  <LI>Create a custom indicator of the Close. 
  <LI>Drag and drop this indicator on the S&amp;P 500 (or whatever...). (Note: 
  the S&amp;P 500 plot must change to pink/lavender color before you drop it.) 
  The indicator will plot. 
  <LI>Select the indicator plot (by single-clicking with the left mouse button 
  on the line). 
  <LI>Do an Exploration with DIV(Close,p) in column A, and specify which 
  directory to explore. 
  <LI>The results are displayed in the Exploration report.<BR></LI></OL>
<P>(P is a special variable that points at the last indicator plotted or 
selected.)<BR></P></FONT></DIV>
<DIV><FONT size=2>============================================</FONT></DIV>
<DIV><FONT size=2>----- Original Message ----- </FONT>
<DIV><FONT size=2>From: &lt;<A 
href="mailto:HARELSDB@xxxxxxx";>HARELSDB@xxxxxxx</A>&gt;</FONT></DIV>
<DIV><FONT size=2>To: &lt;<A 
href="mailto:metastock@xxxxxxxxxxxxx";>metastock@xxxxxxxxxxxxx</A>&gt;</FONT></DIV>
<DIV><FONT size=2>Sent: maandag 22 maart 1999 6:38</FONT></DIV>
<DIV><FONT size=2>Subject: System tests referencing a second 
security</FONT></DIV></DIV>
<DIV><BR></DIV><FONT size=2>&gt; I would like to reference a second security, 
such as an index, in a system<BR>&gt; test and would appreciate any help the 
list has to offer.&nbsp; The test I would<BR>&gt; like to perform 
follows:<BR>&gt; <BR>&gt; Buy ABC long when the x day moving average of the 
ratio of the close of ABC to<BR>&gt; the close of index 1 crosses above the y 
day moving average of the ratio of<BR>&gt; the close of ABC to the close of 
index 1.<BR>&gt; <BR>&gt; A sell signal would be given by a cross of the x day 
average of the ratio of<BR>&gt; the two securities below the y day average of 
the ratio of the two securities.<BR>&gt; <BR>&gt; I can figure out how to write 
the Metastock code for this if I can figure out<BR>&gt; how to get Metastock to 
recognize two securities in the same test.<BR>&gt; <BR>&gt; Thanks for any help 
that is out there.<BR>&gt; <BR>&gt; Dan<BR>&gt; Pocatello, ID 
usa</FONT></BODY></HTML>
</x-html>From ???@??? Mon Mar 22 21:08:22 1999
Received: from listserv.equis.com (204.246.137.2)
	by mail02.rapidsite.net (RS ver 1.0.2) with SMTP id 8809
	for <neal@xxxxxxxxxxxxx>; Mon, 22 Mar 1999 19:07:49 -0500 (EST)
Received: (from majordom@xxxxxxxxx)
	by listserv.equis.com (8.8.7/8.8.7) id HAA07375
	for metastock-outgoing; Tue, 23 Mar 1999 07:30:07 -0700
X-Authentication-Warning: listserv.equis.com: majordom set sender to owner-metastock@xxxxxxxxxxxxx using -f
Received: from freeze.metastock.com (freeze.metastock.com [204.246.137.5])
	by listserv.equis.com (8.8.7/8.8.7) with ESMTP id HAA07372
	for <metastock@xxxxxxxxxxxxxxxxxx>; Tue, 23 Mar 1999 07:30:05 -0700
Received: from subcellar.mwci.net (subcellar.mwci.net [205.254.160.2])
	by freeze.metastock.com (8.8.5/8.8.5) with ESMTP id QAA00773
	for <metastock@xxxxxxxxxxxxx>; Mon, 22 Mar 1999 16:22:59 -0700 (MST)
Received: from mwci.net (dial-116.elkader.mwci.net [209.207.8.116])
	by subcellar.mwci.net (8.8.8/8.8.8) with ESMTP id RAA28142
	for <metastock@xxxxxxxxxxxxx>; Mon, 22 Mar 1999 17:11:22 -0600 (CST)
Message-ID: <36F6CD9D.840E8F08@xxxxxxxx>
Date: Mon, 22 Mar 1999 17:09:17 -0600
From: Barry Spreen <bspreen@xxxxxxxx>
X-Mailer: Mozilla 4.5 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: metastock@xxxxxxxxxxxxx
Subject: Re: Error Code....
References: <009101be7497$900b5ca0$bcacfad0@xxxxxxx>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-metastock@xxxxxxxxxxxxx
Precedence: bulk
Reply-To: metastock@xxxxxxxxxxxxx
X-Loop-Detect: 1
X-UIDL: b664ee61c163463affa5f4e5b6253ec0.03

Adam,

I would think that the error code would indicate a missing quotation mark at the
end of something which would be supposed to be a string (ie a sentence etc.)

Could this be the problem. I don't know why it would work on one system and not
another.

Barry

Adam Hefner wrote:

> I have recently developed some new code that calculates from a daily bar
> chart
> what the weekly bar chart trend would be. Why do this? This allows for
> testing
> trading Ideas on a daily chart, using the weekly trend bias. These codes
> work
> well on my system......but when these codes where placed on a different
> system
> there is an error:
>
>                               "Formula contains invalid code (unterminated
> string literal)".
>
>  My question is,  what exactly is this error telling me?  The code has been
> checked
> for errors, and we have tried different variable usage.......but it would
> help in our
> diagnostics if I new exactly what this error means. I should also explain
> that the
> first two codes calculate the weekly highs and lows, the 3rd calculates the
> swing
> and the 4th (The error happens with this code) calculates the trend. The
> swing code
> uses results from the first two and the trend code uses the results from the
> swing code.
> Thanks in advance.
>
>   Best wishes,
>       Adam Hefner.
> VonHef@xxxxxxxxxxxxx
>
> ---------------------------------------