PureBytes Links
Trading Reference Links
|
Herman and
Bob,
Below is a posting from
the [MetastockUsers] group in Yahoo!Groups. I was writing this in response
to someone's question/assertion that you couldn't test a system across a
porfolio of stocks (I do agree that you can't do it in the Metastock System
Tester...).
Notice the
EQTY:= variable that I'm using. You can plot this
separately as FmlVar("IndicatorName","EQTY") in any chart and it will give you
an Equity line. You can also apply a Moving Average to it, or write it
into the formula itself.
<FONT color=#000080 face="Century Gothic"
size=2>-------------------------------------------------<FONT
color=#000080 face="Century Gothic" size=2>
> > --- In
Metastockusers@xxxx, "John R" <jrdrp@xxxx> wrote:
> > >
K,
> >
>
> > > 1. You can use the Metastock Explorer to scan
multiple selected stock files<FONT
color=#000000>
> > > for those which satisfy a specified set of
conditions e.g. 10 day EMA
> > > crossed
above 10 day EMA and volume surge in last 2 days.<FONT color=#000080
face=Arial>
I beg to differ on this thread. Given certain limitations,
there's a lot of systems that can be tested in Metastock, as is--Version 6.52 on
up as far as I know....
You can create your system within an indicator, calculate
whatever system statistics you'd like, and run those in an
Exploration.
Here's an example. I will use John's suggestion above.
This is a Long only system which enters when the Close crosses above the 10
period simple MA and volume is 10 percent greater each time on two successive
bars.
ExampleIndicator<FONT
color=#000080 face=Arial size=2>
DelayOnEntry:=1;<FONT color=#ff0000
face=Arial size=2>
{This corresponds to the Options Button on the System
Tester}
Periods:=10;<FONT color=#ff0000
face=Arial size=2>
{Moving Average Length}<FONT
color=#000080 face=Arial size=2>
EntryPoint:=CLOSE;<FONT color=#ff0000
face=Arial size=2>
{DITTO: This corresponds to the Options Button on the
System Tester}
EnterLong:=If(Cum(1)=Periods+3,1,Cross(C,Mov(C,Periods,S))
AND (V>1.1*Ref(V,-1) AND Ref(V,-1)>1.1*Ref(V,-2)));
<P
align=left>ExitLong:=If(Cum(1)=Periods+4,1,Cross(Mov(C,Periods,S),C));
<P
align=left>POSN:=If(Ref(BarsSince(EnterLong)<=BarsSince(ExitLong),-1*DelayOnEntry),1,0);
<P
align=left>EQTY:=Cum(If(Ref(POSN,-1)=1,EntryPoint-Ref(EntryPoint,-1),0));
TotTrades:=Cum(Cross(POSN,0.5));
<P
align=left>WinTrade:=(ValueWhen(1,Ref(Cross(POSN,0.5),-1),EntryPoint)<ValueWhen(1,Ref(Cross(0.5,POSN),-1),EntryPoint));
Winners:=Cum(Cross(WinTrade,0.5));
Notice that I've put in three different calculations in
this "indicator". I have Equity, total trades, and winning trades.
You can use this in an exploration as
follows:
Col A: {System Equity}
FmlVar("ExampleIndicator","EQTY");
ColB: {Total Trades}
FmlVar("ExampleIndicator","TotTrades");
ColC: {Winning Trades}
FmlVar("ExampleIndicator","Winners");
ColD: {Winning Percentage}
<P
align=left>FmlVar("ExampleIndicator","Winners")/FmlVar("ExampleIndicator","TotTrades");
ColE: {Equity per Trade}
<P
align=left>FmlVar("ExampleIndicator","Eqty")/FmlVar("ExampleIndicator","TotTrades");
You'll get results something like the screen capture
below. This was a test over a portfolio of 381 stocks. You can sort the results
by any column you'd like, export this to Excel for portfolio summary analysis,
etc.
<<<<<
Screen capture is in
the message that follows>>>><FONT color=#000080
size=2>
So, really you can do anything you like. You are limited only by
the Formula Language (which remains a limiter in the System Tester as well) and
by the total number of columns you can use in an Exploration.
I provide the previous system just as an example of what you can
do currently in Metastock. Mine is V.03 Professional, but any version will
work.
By the way John.....nice system! Overall, as a portfolio, on my
381 high volume stocks, using 1300 bars of EOD data (approx. 4 years), the
overall results were 263 points net with a winning percentage of 46%. Perhaps
you should contact Equis with your idea for the next release -- 7.3???
Dave Nadeau
Fort Collins, CO
> -----Original Message-----> From:
owner-metastock@xxxxxxxxxxxxx> [<A
href="mailto:owner-metastock@xxxxxxxxxxxxx"><FONT
size=2>mailto:owner-metastock@xxxxxxxxxxxxx]On Behalf Of
Herman van den Bergen> Sent: Monday, May 21, 2001 12:45 PM> To:
metastock@xxxxxxxxxxxxx> Subject: Re: System Tester Equity
Line>>> At 12:25 PM 5/18/01 -0700, you wrote:>
>To List & MS Support:> >> >Is there any way to gain
access to the Equity Line> >in System Tester, as either an indicator
or data> >field?>> Hi John, I have been trying to work
this out also. The only way, I am told> by MS Support and private
programmers, is by writing a custom DLL. However> it would not allow you
to change your trading formulas on the fly while> running your system
tester - so if you change your rule you would have to> change your
DLL.>> I assume you are trying to get Equity feedback to modify
your stops and> trading rules - this is what i am working on. What you
can do is write two> trading systems and run first the one without Equity
feedback> then "select"> the displayed equity curve and run your
second trading system which> accesses the selected equity curve by using
the P variable. It is a bit of> a work around and troublesome as always
you have to run two systems to get> your results.>> I can't
find the post someone referred to however I have emailed> the
person> who was suppossed to have posted it. If you email me your email
address we> can exchange info on this topic - you can reach me at
psytek@xxxxxxxx MS> support also emailed me a partial solution - I don't
like copying others'> email to the net but can email it to you
privately.>> I have simulated Equity feedback in Excel and to me
it seems to work very> well. You can perform TA on the equity line, to
tell you when to reverse> your position (without changing rules) or go
into cash.>> Well, email me if you are interested in exchanging
ideas on this project.> We could even form a small group to work on
this.>> Happy trading,> Herman.>>
>> >Let's say I wished to apply a moving average to the>
>Equity Line, and decided I wanted my system> >to automatically
exit,if the Equity Line> >crossed its moving average.Is it possible
to> >specify such a condition within the System tester>
>Entry/Exit conditions?> >> >> >By the way, I'm
referring to MS 7 EOD.> >> >Bob> >>
>Thanks.> >> >> >>
>__________________________________________________> >Do You
Yahoo!?> >Yahoo! Auctions - buy the things you want at great
prices> ><A href="http://auctions.yahoo.com/"
target=_blank>http://auctions.yahoo.com/<FONT
size=2>> >>
|