Page 8
Bullish Engulfing
Pattern
ColA: CLOSE
Filter BarsSince(EngulfingBear())<=5 AND
BarsSince(ROC(C,60,%)>15)<=5 AND BarsSince(Stoch(9,1)>90)<=5
Filter enabled Yes
Periodicity Daily
Records required 1300
Bearish Engulfing Pattern
Col A: CLOSE
Filter BarsSince(EngulfingBull())<=5 AND
BarsSince(ROC(C,60,%)<-15)<=5 ANDBarsSince(Stoch(9,1)<10)<=5
Filter enabled Yes
Periodicity Daily
Records required 1300
Up 20%
on Double Average Volume
Col A: CLOSE
Col B:ROC(C,5,%)
Filter ROC(C,5,%)>=20 AND Mov(V,5,S)>=(2*Ref(Mov(V,60,S),-5))
Filter enabled Yes
Periodicity Daily
Records required 1300
Down
20% on Double Average Volume
Col A: CLOSE
Col B: ROC(C,5,%)
Filter ROC(C,5,%)<=-20 AND Mov(V,5,S)>=(2*Ref(Mov(V,60,S),-5))
Filter enabled Yes
Periodicity Daily
Records required 1300
Cross
Above 200 MA on Twice Average Volume
Filter (C>Mov(C,200,S) AND Ref(C,-5)<Ref(Mov(C,200,S),-5)) AND C>5
AND V>Mov(V,200,S)*2
Crossing Below 200 Day MA on Double Average Volume
Filter (C<Mov(C,200,S) AND Ref(C,-5)>Ref(Mov(C,200,S),-5)) AND C>5
AND V>Mov(V,200,S)*2
Consolidation Over 16 Weeks
Col A: CLOSE
Filter Fml("congestion index") <= 10 AND BarsSince(Fml("congestion
index")>10) > 0
Filter enabled Yes
Here is the "congestion index" formula:
((HHV(C,80)-LLV(C,80))/LLV(C,80))*100
Consolidation
Breakout, Upside
Col A: CLOSE
Filter: Fml("Consolidation breakout (upside)") = 1
Filter enabled: Yes
Consolidation Breakout, Downside
If(Ref(Fml("congestion index"),-5),<,10,
{and} If(Fml("congestion index"),>=,10,
{and} If(CLOSE,>,Ref(HHV(C,80),-5),
{and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)),
+1,0),0),0),0)
Stocks breaking out of consolidation (downside)
Col A: CLOSE
Filter: Fml("Consolidation breakout (downside)") = 1
Filter enabled: Yes
Here is the "consolidation breakout(downside)" formula:
If(Ref(Fml("congestion index"),-5),<,10{%},
{and} If(Fml("congestion index"),>=,10{%},
{and} If(CLOSE,<,Ref(LLV(C,80),-5),
{and} If(Mov(V,5,S),>=,1.5*(Ref(Mov(V,60,S),-5)),
+1,0),0),0),0)
Volatility Over 16 Weeks
Col A: CLOSE
Col B: Vol(10,80)
Filter: Vol(10,80)>200
Filter enabled: Yes
Gain
By %
Col A: CLOSE
Col B: ROC(C,5,%)
Filter: (ROC(C,5,%)>10 OR ROC(C,5,%)<-10) AND C>5
Filter enabled: Yes
Biggest Losers
Col A: CLOSE
Col B: ROC(C,5,%)
Filter: (ROC(C,5,%)>10 OR ROC(C,5,%)<-10) AND C>5
Filter enabled: Yes
Overbrought/Over Sold
Col A: CLOSE
Col B: Fml("ob/os summation")
Filter: Fml("ob/os summation") > 450 OR Fml("ob/os summation") < -50
Filter enabled: Yes
Here is the "ob/os summation" formula:
RSI(25)+Stoch(25,3)+Mo(25)+CCI(25)
Elliot
Wave Identification
As far as using MetaStock for identifying waves, use a 5/34
histogram for
finding wave 4, the end of wave 3 and for help with identifying wave
1/2,
which apparently Advanced Get uses extensively. You can write
MetaStock
explorations/templates/experts, etc., with this indicator; e.g.,
explorations to find the peaks and troughs of the 5/34 histogram.
The version of the indicator I use in MetaStock v6.52 is:
Mov(OscP(5,34,E,$),5,S)
-150 days minimum of data.
The peaks of the histogram help identify waves 1, 3 and 5 and
troughs for
waves 2 and 4. Use MetaStock line studies (both trendlines, channels
and
fib retracements) for additional wave identification/analysis. Of
course,
you can label the waves with the text box.
from Kevin Campbell
Wilders ATR From Equis
{The actual ATR does not use a simple moving average. Welles Wilder
uses
his own smoothing (a modified exponential average) which is the
function
named "Wilders" in MetaStock. Try your formula this way:}
periods:=Input("ATR Periods?",1,100,10);
TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;
Wilders(TR,periods)
{Equis Support}
ATR Custom Indicator
periods:=Input("ATR Periods?",1,100,10);
TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;
Mov(TR,periods,S)
{from Yngvi Hardarson}
MTF Tendency Update
{Multiple Time Frame - Tendency 5/23/99}
{This will plot 1 for Bullish
-1 for Bearish}
dw:=DayOfWeek();
Fw:=If(dw<Ref(dw,-1),1,0);
Mt:=If(Fw=1 AND Ref(dw,-1)<>5,
{then}Ref(C,-1)- FmlVar("MTF-Fixed Balance Point","DWP"),
{else}If(dw=5,
{then}C-((HighestSince(1,Fw=1,H)+
LowestSince(1,Fw=1,L)+C)/3),
{else}0));
If(Mt>0,1,If(Mt<0,-1,0));
{from Adam Hefner}
Guppy
MMA Exploration from Trading Tactics, part 2
NOTE This EXPLORATION uses the results of
several INDICATOR FORMULAS. You must create the INDICATORS first
before running the exploration. Also, depending on your system you
may have some problems importing this into early versions of
Metastock 7.
Ref(C,-1)
Ref(C,-2)
Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma
10/45")+Fml("mma 12/50")+Fml("mma 15/60")
Ref(Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma
10/45")+Fml("mma 12/50")+Fml("mma 15/60"),-1)
Ref(Fml("mma 3/30") +Fml("mma 5/35") +Fml("mma 8/40") + Fml("mma
10/45")+Fml("mma 12/50")+Fml("mma 15/60"),-2)
When(colD,>,0) AND When(colE,<=,0)
Performance Intra Day and Daily
ColA:C {label CLOSE}
ColB:O {label OPEN}
ColC:Sub(C,O) / O {label Intr.dy%}
ColD:Sub(C,Ref(C,-1)) / Ref(C,-1) {label 1 dy %}
ColE:Sub(C,Ref(C,-2)) / Ref(C,-2) {label 2 dy %}
ColF:Sub(C,Ref(C,-3)) / Ref(C,-3) {label 3 dy %}
Filter: O>.2 AND
C<.3 AND
C>.2
Filter: enabled
Periodicity: Daily
Records required: 5
Patrick McDonald
Gap Up
System with Delayed Exit
Enter long
GapUp()
Close long
Ref(GapUp(),-5)
Initial equity 10000
Positions Long and short
Trade price Open
Trade delay 1
Entry commission 0%
Exit commission 0%
Interest rate 0%
Margin req. 100%
Elliot
Oscillator
Mov(C,5,S)-Mov(C,35,S)
{from Jan Robert Wolansky}
{TIMESERIES TRIX - by Joe Luisi}
{published in S&C - TASC article "Playing Trix" by Joe Luisi (June
1997) and
to be used on weekly data}
CLA:=TRIX(3);
CLB:=Ref(TRIX(3),-1);
CLC:=Mov(TRIX(3),8,TIMESERIES);
CLD:=Ref(Mov(TRIX(3),8,TIMESERIES),-1);
SHORT:=When(CLA,>,CLC) AND When(CLB,<,CLD) AND
When(CLA,<,0)AND When(CLA,>,-2);
LONG:=When(CLA,<,CLC) AND When(CLB,>,CLD) AND
When(CLA,>,0)AND When(CLA,<,+2);
If(LONG>0,+1,
If(SHORT>0,-1,PREVIOUS))
Weekly Trix
Moving Average Test
COLA: TRIX(3)
COLB: REF(TRIX(3),-1)
COLC: MOV(TRIX(3),8,TIMESERIES)
COLD: REF(MOV(TRIX(3),8,TIMESERIES),-1)
COLE: C
Filter enabled:yes
when(cola,>,colc)and when(colb,<,cold)and when(cola,<,0)and
when(cola,>,-2)
from A. J. Maas
ROC
Moving Average System Test
ENTER LONG:
ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)>0
EXIT LONG:
(ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)>0)
OR
(ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)<0)
SHORT:
ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)<0
EXIT SHORT:
(ROC(Mov(C,12,E),1,%)<0 AND ROC(Mov(C,60,E),1,%)>0)
OR
(ROC(Mov(C,12,E),1,%)>0 AND ROC(Mov(C,60,E),1,%)<0)
{Ref(c,-1) gives yesterday's close today. So all values are shifted
to the
right!}
{from Onno Goedknegt}
Days Since Crossover
{place formula in filter section of explorer, making sure that
formulas
within quotes are valid indicators}
BarsSince(Cross(45, Fml( "Stochrsi (14)" )))>
BarsSince(Cross(Fml( "Stochrsi (7,3)" ),72)) AND
Ref(BarsSince(Cross(45,Fml( "StochRSI (14)" ))) <
BarsSince(Fml( "staters (7,3)")>72), -1)
{from Stefan Schittko}
Anti
Trigger- LB Raschke (For Metastock v6.5)
Original formula based on L.B. Raschke's "Street Smarts"
book's Quick Indicator Articles. Re-written by Ton Maas.
{FUNCTIONS-IND-REFERENCE-INDEX:
FF=FASTLINE,SS=SLOWLINE,SETBARS=3DAYMOVAVE,
ENTRYADD=+1,EXITADD=+1}
{FUNCTIONS-VAR-REFERENCE-INDEX:
BBUY=(VAR),SSELL(VAR),CBUY(VAR),CSELL(VAR),FF(VAR),SS(VAR),
LXSTOP(VAR),SXSTOP(99999),MP(VAR)}
{FUNCTIONS-MISC-REFERENCE-INDEX:
AT0BBUY =BULLLONG
AT0SSELL =BEARSHORT
AT0CSELL =CLOSEBEARSHORT
AT0CBUY =CLOSEBULLLONG
AT0MP =MARKETPOSITION (-1=LONG,+1 SHORT)
AT0LXSTOP=CLOSELONGEXITLEVEL(STOPLOSS)
AT0SXSTOP=CLOSESHORTEXITLEVEL(STOPLOSS)}
{INDICATOR NAME : ANTI TRIGGER}
{THE FORMULA (+REQUIRED FUNCTIONS) FOR THE ANTI TRIGGER INDICATOR}
AT0SETBARS:=3;
AT0FF:=Stoch(7,AT0SETBARS);
AT0SS:=Mov(Stoch(7,AT0SETBARS),10,E);
AT0ENTRYADD:=+1;
AT0EXITADD:=+1;
AT0CSELL:={use in expadv or systest}{for RT del the REF-function}
If(AT0FF>Ref(AT0FF,-1) AND AT0SS<Ref(AT0SS,-1),C+1,0);
AT0CBUY:={use in expadv or systest}{for RT del the REF-function}
If(AT0FF<Ref(AT0FF,-1) AND AT0SS>Ref(AT0SS,-1),C+1,0);
AT0BBUY:={use in expadv or systest}{for RT del the REF-function}
If(AT0CBUY>AT0SETBARS,H+AT0ENTRYADD,99999);
AT0SSELL:={use in expadv or systest}{for RT del the REF-function}
If(AT0CSELL>AT0SETBARS,L-AT0ENTRYADD,0);
AT0MP:={use in expadv or systest}If(AT0BBUY<99999,
-1,If(AT0SSELL>0,1,0));
{AT0LXSTOP:=}{use in expadv or systest}{for RT del the REF-function}
{IF(REF(AT0MP,-1)<1 OR (REF(AT0BBUY,-1)<99999 AND
H>REF(AT0BBUY,-1)), L-AT0EXITADD,0);}
{AT0SXSTOP:=}{use in expadv or systest}{for RT del the REF-function}
{IF(REF(AT0MP,-1)>-1 OR (REF(AT0SSELL,-1)>0 AND
L<REF(AT0SSELL,-1)), H+AT0EXITADD,0);}
AT0MP
Recursive Moving Trend Average
Lb:=Input("Look-Back Period?",3,100,21);
Ty:=Input("1=C 2=H 3=L 4= Median Price",1,4,1);
Tv:=If(Ty=1,C,If(Ty=2,H,If(Ty=3,L,MP())));
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+Tv;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+
(Alpha*(Tv+Bot-Ref(Bot,-1)));
RMTA
{from Adam Hefner}
TSF
Optimised Trading System for Metastock
Enter long:
Cross(opt1,((CLOSE-Ref(TSF(C,opt3),-1))/CLOSE*100))
Close long:
Cross(((CLOSE-Ref(TSF(C,opt3),-1))/CLOSE*100),opt2)
Enter short:
Cross(((CLOSE-Ref(TSF(C,opt3),-1))/CLOSE*100),opt2)
Close short:
Cross(opt1,((CLOSE-Ref(TSF(C,opt3),-1))/CLOSE*100))
opt 1: zero to -2 (with .1 step)
opt 2: zero to +2 (with .1 step)
opt 3: 2 to 8 (with 1 step)
{I use this for futures and the above parameters (optimized
settings) keep
it in the ballpark. If you are applying it to equities (or
commodities),
it always makes sense to look at the indicator and understand the
outside
parameters for each of its "steps". It makes no sense to limit your
outside
limits to -2 and +2 if the TSF oscillates between -8 and +8. So do a
little
homework on the "outside" limits of the indicator and then
optimize accordingly. from Steve Karnish.}
End
Point Moving Average
{The End Point Moving Average was introduced in the October 95 issue
of
Technical Analysis of Stocks & Commodities in the article "The End
Point
Moving Average", by Patrick E. Lafferty. The exact formula for the
End Point
Moving average is as follows:}
( 14 * Sum( Cum( 1 ) * C,14 ) - Sum( Cum( 1 ),14) * Sum( C,14) ) /
(14
* Sum( Pwr( Cum( 1 ),2),14 ) - Pwr( Sum( Cum( 1 ),14 ),2 ) ) * Cum(
1 )
+ (Mov(C,14,S) - Mov( Cum( 1 ),14,S) * (14 * Sum( Cum( 1 ) * C,14) -
Sum( Cum( 1 ),14 ) * Sum( C,14) ) / (14 * Sum( Pwr( Cum( 1 ),2 ),14)
-
Pwr( Sum( Cum( 1 ),14 ),2 ) ) )
{The above formula plots the last value of a linear regression line
of the
previous 14 periods. The Time Series Forecast (TSF) takes this value
and the
slope of the regression line to forecast the next day and then plots
this
forecasted price as today's value. from Equis.}
Metastock Adjustable Trading Bands
Using the default values used in the formulas, I have found that
these upper
and lower bands provide effective risk control while trading. The
upper band
can be used as the extreme point to get rid of shorts and vice
versa. In
fact, prices tend to remain above both the bands while the market is
in a
strong uptrend, and prices remain below the bands in a downtrend.
During
short-term range-bound markets, they tend move between the bands. I
have
found this idea in Tushar Chande's "New Technical Trader". Since you
have
studied ATR so thoroughly, it would be be very nice if you could
comment on
them. Can be made into a template for easier usage.
from Rajat K Bose
Upper Band
Prd1:=Input("ATR Period",5,20,5);
Prd2:=Input("Period for Highest High Value",5,20,10);
(HHV(LLV(L,Prd1)+ATR(Prd1),Prd2))
Lower Band
Prd1:=Input("ATR Period",5,20,5);
Prd2:=Input("Period for Lowest Low Value",5,20,10);
(LLV(HHV(H,Prd1)-ATR(Prd1),Prd2))
Customisable StochRSI from Nicholas Kormanik
The formula I've adopted was put on the Silicon Investor web site
thread by
'bdog'. Basically, I just leave the Slowing Periods (mp3) to 1, so
it
really plays no part in things. However, if somebody presents a good
argument for using other than 1 ... hey, I'm amenable.
Chande, the original inventor, didn't use a moving average on the
whole
thing. Chande's result was therefore sort of choppy. I guess along
the way
people decided to add the EMA Periods to smooth things out.
Here's the MSWin formula:
mp1:=Input("RSI Periods",1,377,13);
mp2:=Input("Stoch Periods",1,377,13);
mp3:=Input("Slowing Periods",1,377,1);
mp4:=Input("EMA Periods",1,377,5);
Mov(Sum((RSI(mp1)-LLV(RSI(mp1),mp2)),mp3)/Sum((.0000001+(HHV(RSI(mp1),mp2)-(
LLV(RSI(mp1),mp2)))),mp3),mp4,E)*100
Now, from various posts, etc., the following parameters (mp1, mp2
and mp4)
*seem* to be the one's recommended. I'm trying to further find
consensus
among users of StochRSI on what really appears to work for them.
StochRSI Set
--------------------
5 -- 5 -- 3
8 -- 8 -- 5
13 -- 13 -- 13
21 -- 15 -- 13
21 -- 21 -- 13
34 -- 34 -- 13
55 -- 55 -- 21
89 -- 13 -- 34
89 -- 89 -- 21
233 -- 233 -- 34
52
Week Hi-Lo Exploration
ColA: {Close}C;
ColB: {52-week High} HighestSince(1, (DayOfMonth()=08 AND Month()=05
AND Year()=1998), H);
ColC: {52-week Low} LowestSince(1, (DayOfMonth()=08 AND Month()=05
AND
Year()=1998), L);
{Choose one of these filters}
{Filter 1:} ColA >= (0.9*(ColB))
{Filter 2:} ColB >= 2*ColC
{If you want both the conditions to be satisfied in the same query,
just
join the two filters by the AND operator:}
Filter: (ColA >= (0.9*(ColB)) AND ColB >= ColC)
{One problem with the 52-wk High and 52-wk Low formula--every day
you've got
to change the values for dayofmonth(), Month() and Year() functions.
The
formula given above assumes that you would be running the query on
May 07,
1998. Change the values of the above functions accordingly.}
{from Rajat Bose}
Trailing Stop Loss Indicator
If(cum(1)=1,
{then} Close,
{else} If((C*1.1) <= PREV,
{then}(C*1.1),
{else} PREV));
{from Adam Hefner}
{Regarding the Recursive Moving Trendline System, I ended up making
an
oscillator out of it (subtracting the ema from the rta). If you wish
to try
"tuning" it in MetaStock, you could try different entry levels from
the
oscillator. For example, go long when TOSC crosses from below -2, or
go
short when TOSC crosses from above +2. }
{TOSC}
Lb:=Input("Look-Back Period?",3,100,21);
Ty:=Input("1=C 2=H 3=L 4= Median Price",1,4,1);
Tv:=If(Ty=1,C,If(Ty=2,H,If(Ty=3,L,MP())));
Alpha:=2/(LB+1);
Bot:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+Tv;
RMTA:=(1-Alpha)*(If(Cum(1)<Lb,Tv,PREV))+
(Alpha*(Tv+Bot-Ref(Bot,-1)));
TOSC:=RMTA-Mov(Tv,lb,E);
TOSC;
{NOTE: this code will work slowly because of all of the "PREV"
functions.
from Adam Hefner.}
{Single 60 Day Period BreakOut Signal Indicator}
ACol:= C;
BCol:= Ref(HHV(H,59), -1);
CCol:= HHV(H,60);
SSDPBOS:= (ACol>BCol) AND (Ref(C,-1)<BCol) AND
(H=CCol);
SSDPBOS
{from Ton Maas}
Metastock-Stocks Closing Above 60 Day High
To find the securities that have closed above their high today (the
last
trading day in the database) for the first time, I have written this
MetaStock Explorer.
ColA: {Close) C
ColB: {Previous 60-day High} Ref(HHV(H,60), -1)
ColC: {Current 60-day High} HHV(H,60)
ColD: {Volume} V
Filter: (colA>colB) AND (Ref(C,-1)<Ref(HHV(H,60), -1)) AND
(H=HHV(H,60))
This formula does two things:
1) It lists only those securities which have met the required
conditions
only on the last trading day.
2) The new 60-day high must have taken place only on the last
trading day.
from Rajat Bose
{Stocks Closing Above 60 Day Highs}
{closing above the 60-day high of the close}
close>ref(hhv(close,60),-1)
if you want those that are {closing above the 60-day intraday high}
close>ref(hhv(high,60),-1)
{from Debra Orlow}
Sine
Weighted Moving Average
{from Equis}
PI:=3.1415926;
SD:=180/6;
S1:=Sin(1*180/6)*C;
S2:=Sin(2*180/6)*Ref(C,-1);
S3:=Sin(3*180/6)*Ref(C,-2);
S4:=Sin(4*180/6)*Ref(C,-3);
S5:=Sin(5*180/6)*Ref(C,-4);
Num:=S1+S2+S3+S4+S5;
Den:=Sin(SD)+Sin(2*SD)+Sin(3*SD)+Sin(4*SD)+Sin(5*SD);
Num/Den
I use the peak and trough function in MetaStock to show support and
resistance levels. It could also be used as a trailing stoploss
method.
from Anil Chugani
Support and Resistance Levels
AVd:=If(CLOSE>Ref(Peak(1,H,1) ,-1),
{then}1,
{else}If(CLOSE<Ref(Trough(1,L,1),-1),
{then}-1,
{else}0));
ANv:=ValueWhen(1,AVd<>0,AVd);
SuRe:=If(ANv=-1,
{then}Peak(1,H,1),
{else}Trough(1,L,1));
SuRe;
{StochCMO}
mp1:=Input("RSI Periods",1,377,13);
mp2:=Input("Stoch Periods",1,377,13);
mp3:=Input("Slowing Periods",1,377,1);
mp4:=Input("EMA Periods",1,377,5);
Mov(Sum((CMO(c,mp1)-LLV(CMO(c,mp1),mp2)),mp3)/Sum((.0000001+(HHV(CMO(c,mp1),
mp2)-(LLV(CMO(c,mp1),mp2)))),mp3),mp4,E)*100
25x25
Bond System Metastock Format
more detail at http://www.traderclub.com
This system is provided free to people who join the System Traders
Club. It is a profitable Bond Trading System that we supply in order
to demonstrate the quality of our work, and as an example of the
documentation that comes with each of our systems.
Gary Randal mailto:Randall_Gary@tmac.com has ported this system into
MetaStock format. His comments and code for MetaStock follow our
normal system Documentation. A Rrade by Trade Report concludes the
document
"25 x 25" BOND TRADING SYSTEM
by Charles LeBeau and Terence Tan
Introduction
In this report we will present several useful concepts for trading
the Bond futures markets, and illustrate these concepts with a Bond
trading system that we have called the "25 x 25". The "25 x 25"
system is a long-only trend-following system designed for the Bond
market which has made hypothetical profits of $53,000 over the last
10 years of historical data, with an accuracy rate of 76%.
Aims of the System Traders Club
Before we present the details of the system, we will review some of
the goals we hope to achieve for the System Traders Club.
First, we do not hope to reveal any "holy grails" to trading. Many
of the systems that you will see in the System Club reports include
indicators that you may already be familiar with, or that can be
easily programmed into the computer. In addition, you will find that
many of these systems are not perfect: they will all have drawdowns,
and none of them are 100% accurate over the long run. However, we
think they deserve serious consideration for actual real-time
trading applications. We realize that in the business of trading the
futures markets there is no single method that makes money
automatically. We believe that a combination of logical system
concepts and reasonable entry and exit strategies greatly increases
the probability of success in trading. We hope to be able to
communicate to you, through these reports, many of the concepts that
we have learned over the years.
Second, we hope that these reports will serve both an informative as
well as a practical purpose. We will share with you lessons that we
have accumulated over the years regarding trading strategies and
techniques that have worked in various markets, and the logic behind
them. You may also want to view the systems presented as
illustrations of general principles and concepts in systematic
trading of the futures markets. We hope that you may also apply
these concepts to your own favorite markets and time-frames. We
would welcome any feedback you may have on possible improvements and
different applications of these systems.
Third, we intend to provide many different systems and market
combinations in our reports. Multiple systems can be combined
together in a portfolio to generate more frequent trades and higher
returns than any single system. We believe in diversification; but
we also realize that diversification is a function of personality
and preference. For this reason, we will be offering many different
types of systems, from which you will be able to select systems that
suit your personality and preference and combine them into your own
diversified trading portfolio.
"25 x 25" System Rules
We will concisely present the system rules first, and then elaborate
and explain the concept and logic behind some of the more important
trading techniques represented in the system:
To go long in the Bond market, three conditions must be met.
1. The 14-day +DI must be above the 14-day -DI.
2. The 14-day ADX must be above 20.
3. The 4-day RSI must be below 50.
If these three conditions are met then buy tomorrow only if and when
prices rise 18 ticks (18/32) above today's close. Enter on a buy
stop order.
After a trade has been entered, place a sell stop at whichever of
the positions below are closest to the market price.
1. A stop order at $2,500 below the entry price.
2. Or a stop order at the lowest low of the last 25 days.
3. After 25 days (count entry day as day 1), change stop #2 from
the lowest low of 25 days to the lowest low of 2 days.
4. Regardless of the number of days in the trade, after any close
where the open profit is greater than 5 Average True Ranges the
exit stop should be at the lowest low of 2 days. (Important: use 45
days to calculate the ATR)
Historical Results
Table 1 shows the historical results of trading 1 contract on the
system tested over 10 years of data. For the testing purposes, we
used continuous back-adjusted daily data. We ignored all night
sessions, and all calculations were based on day-session prices and
ranges only. $100 was deducted from every trade to simulate the
effects of commissions and slippage. The test period was from 1/1/88
to 1/16/98 with MaxBarsBack set to 50 to enable adequate smoothing
on the ADX calculations. (MaxBarsBack refers to the number of bars
of data necessary to calculate the rules in a system. System rules
only begin after the MaxBarsBack period. The test period includes
the MaxBarsBack period, so that no trades are taken for the first 50
trading days.)
Table 1. “25 x 25” System v.2.0 Hypothetical Results (TradeStation
format) This system was created originally for Tradestation and then
interpreted into MetaStock Format by one of our members. We do not
have MetaStock reports.
Total net profit $ 55,112.50 Open position P/L $
1,875.00
Gross profit $ 64,887.50 Gross loss $-9,775.00
Total # of trades 32 Percent profitable 72%
Number winning trades 23 Number losing trades 9
Largest winning trade $ 5,181.25 Largest losing trade
$ -2,600.00
Average winning trade $ 2,821.20 Average losing trade
$ -1,086.11
Ratio avg win/avg loss 2.60 Avg trade(win & loss) $
1,722.27
Max consec. winners 5 Max consec. losers 2
Avg # bars in winners 26 Avg # bars in losers 12
Max intraday drawdown $ -3,381.25
Profit factor 6.64 Max # contracts held 1
Account size required $ 3,381.25 Return on account
1,630%
The hypothetical performance data above was generated using Omega
TradeStation, with $100 deducted per trade for commissions and
slippage. In our opinion, the "account size required" and "return on
account" calculations may not accurately reflect the actual account
size required to trade this system nor the return to be expected.
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.
HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT
LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS
DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT
ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER
COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH
AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO
SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF
HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR
IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN.
System Concept
The concept behind the system is simple. We designed 25 x 25 to be a
trend following system that will enter an uptrend during a dip in
prices. To do this we will implement three entry strategies. First,
there is a trend indicator to identify a strongly uptrending market.
Second, there is a shorter term retracement indicator that will
identify a small dip in the uptrend which will set up the trade.
Third, we have a precise short-term entry signal which will enter
the trade when the uptrend resumes.
Trend Indication
For the trend indicator, we employ one of our favorite trend
indicators, the Directional Movement Indicator. Specifically we will
use the relationship between the +DI (Plus Directional Indicator),
-DI (Minus Directional Indicator), and the ADX (Average Directional
Movement Index). These indicators were described by Welles Wilder in
his book, New Concepts In Technical Trading Systems, and are
pre-programmed into most of the modern computerized charting
software. The default value chosen by Mr Wilder was 14-days for all
the indicators, and this is the value we have chosen for the system.
For our trend indication, we will require that the 14-day +DI must
be above the 14-day -DI, and that the value of the ADX must be above
20. The relationship of the +DI to the -DI is a useful way of
determining the direction of the intermediate trend; however this
definition of trend is inadequate without the inclusion of the ADX
which actually measures the strength of the trend. Trend indicators
traditionally only indicate whether the trend is up or down, which
is not an accurate representation of how the market behaves. As you
are aware, markets spend most of their time neither in an uptrend or
downtrend, but in a sideways market. By demanding that the ADX be
above 20, we effectively filter out these sideways markets, and
enable our system to enter during periods of relatively strong
uptrends. It is important to understand that the ADX does not
indicate the direction of the trend, merely its strength, which is
why we need to combine the strong ADX reading with the DI
relationship.
As a general concept it is a good idea to always trade markets
according to the direction of the intermediate trend. For instance,
with our trend indicator installed, the 25 x 25 system made $53,000
over 10 years with an accuracy of 76%, and had an average trade of
$1,829. This indicator included a requirement for the ADX to be
above 20.
To assess the impact of an uptrend in trading the Bond market from
the long side, we eliminated the ADX requirement and reversed the
rules of the system so that it only took trades when the +DI was
below -DI, indicating a downtrend. The results are illuminating:
trading the Bond market with all the same entry signals but during a
downtrend as defined as -DI being above +DI produced losses of $781
over 10 years of trading, with a dismal accuracy of 29%, an average
trade of -$6, and a drawdown of $25,000! You clearly do not want to
be buying the Bond market using this technique in an intermediate
downtrend.
We have mentioned the value of the ADX value in assessing the
strength of the uptrend. To see the impact of the ADX value, we
re-tested the system to see how it would perform if the ADX were
below 20 while maintaining the requirement for the +DI to be above
the -DI. When the ADX is below 20 in a prevailing uptrend (as
defined by the +DI and -DI relationship), the system only made
$8,900, was only 47% accurate, and had an average trade of only $595
and a drawdown of $6,500, a significant deterioration of results. We
conclude that an uptrend indication on a trend indicator such as the
DI only gives average results; however, combining the trend
indicator with an ADX value is significantly superior because the
ADX level serves to filter out periods of sideways markets.
Retracement Indicator
The second indicator we have adopted is the 4-day RSI (Welles
Wilder's Relative Strength Index) which we use to identify a
short-term dip in the market prices during the prevailing uptrending
Bond market. We use the RSI because of its popularity and inclusion
in most charting applications. Mr Wilder described a longer-term
RSI, and our choice of a 4-day RSI reflects our design intention of
identifying short-term retracements that would set up high
probability trades. The RSI oscillates between a minimum and maximum
value of 0 and 100. When the RSI declines to below 50 (the
midpoint), we have defined a short-term decline in the market.
Does the short-term decline, as measured by the 4-day RSI falling
below 50 actually make that much difference to trading this market?
To study the difference, we ran another test on the system with the
exact same rules, but eliminating the 4-day RSI rule. The tests over
10 years of data showed a profit of $22,400 over 51 trades, with an
accuracy of 51%, an average trade of $440, and a drawdown of $9,200.
The results are striking: by eliminating the retracement indicator
and entering the markets at any point during an uptrend, the system
makes less than half of the profits made when entering on a
short-term decline. The average trade declined to less than 25% of
the average trade when entering during a retracement! ($440 as
compared with $1,800). We concluded therefore that in an uptrending
Bond market, waiting for a short-term decline or dip in prices to
set up a long trade is preferable to entering the trend on strength.
Entry Trigger
With the +DI, -DI and ADX rules in place, and a short-term market
decline measured by the RSI, we have identified a market situation
that is highly bullish. What we require next is a very short term
indicator that will get us into the market. In our opinion, this
particular indicator is the least important. It only serves to time
our entry a bit more precisely. In fact, our tests show that you
could ignore this entry trigger, and just enter the trade on the
opening of the next trading day after the ADX and RSI setups are
present, to get a profit of $49,600 over 10 years and 57% accuracy
with an average trade of $974, a drawdown of $6,000, and a profit
factor of 2.63! Entering on the open would have traded 51 times over
the last 10 years, significantly more than the 29 trades with our
18-tick entry rule.
But entering on the opening after a decline has its difficulties,
especially if the market continues to decline. On a psychological
level, many traders (including us) are more comfortable knowing that
the market is moving up in the direction of the trade before
entering the position. Hence the logic of our entry trigger: to wait
till the market proves itself by rallying 18 ticks from the previous
day's close before we enter the trade. This is a significant rally,
but forcing the prices to rally significantly before entering
enables the system to produce a much higher percentage (76% over 10
years) of winning trades.
There is no particular magic about the 18-tick number. In fact to
test the robustness of this entry parameter, we ran a series of
tests using the same entry rules, and varying the entry trigger from
2-ticks to 36-ticks above the closing price. The results are
presented in Table 2 below.
The most significant fact of the optimization is that all the tests
are profitable, which is a good indicator of a parameter robustness.
Significantly also, all tests have large average trades exceeding
$1,000 per trade, and all tests show profit factors better than
2.50, and no drawdown on any test is greater than $6,000. It
probably does not matter how many ticks above the close you decide
to take for the entry point. As mentioned previously, even blindly
entering on the opening is profitable over the historical data.
Also, we could trade more frequently if we acted on smaller moves
above the previous close, but we would expect to have a lower
percentage of winners. For instance, we could have chosen a smaller
move of 8 ticks above the close to get a profit of $52,500 on more
trades (40 trades), but with a lower accuracy rate (68%) and a
slightly higher drawdown ($5,600). Since all tests are profitable,
if a trader wishes to deviate from the published system, we will
leave it up to the individual trader to decide which profile of
trades bests suits him.
Table 2. Optimization Results on Entry Trigger Parameters
Ticks Net Profit Avg Trde PFact MaxDD #Trds %Prft
2.00 54712.50 1189.40 2.93 -5168.75 46 61
4.00 54087.50 1175.82 2.95 -4825.00 46 59
6.00 48475.00 1101.70 2.66 -5606.25 44 61
8.00 52562.50 1314.06 3.39 -5668.75 40 68
10.00 48575.00 1278.29 3.39 -5731.25 38 68
12.00 49300.00 1332.43 3.72 -5793.75 37 70
14.00 51375.00 1467.86 4.69 -3881.25 35 71
16.00 48837.50 1575.40 5.40 -4256.25 31 71
18.00 53068.75 1829.96 7.17 -3381.25 29 76
20.00 46100.00 1589.66 5.01 -4037.50 29 72
22.00 46700.00 2030.43 7.64 -4100.00 23 78
24.00 46362.50 2107.39 8.66 -4131.25 22 82
26.00 39306.25 1871.73 6.11 -4193.75 21 76
28.00 30787.50 1620.39 4.71 -4256.25 19 68
30.00 15343.75 1022.92 2.52 -4318.75 15 60
32.00 17637.50 1356.73 3.05 -4381.25 13 62
34.00 16400.00 1490.91 3.02 -4443.75 11 64
36.00 12281.25 1228.13 2.50 -4506.25 10 60
Testing the Entry Technique
Often, when we want to study the effectiveness of an entry technique
by itself, we do optimization tests on the entry technique and exit
simply at a close X days in the future. This often gives a good
indication of the profit potential of any entry technique. The
percentage of winning trades is a good indication of the efficiency
of the entry technique. Table 3 below presents the results of the
entry technique described above, and exiting at the Xth close after
the entry. These tests do not include any money management stops or
any other risk-management strategies.
Notice that all exits were profitable except an exit on the first
close, which amounts to exiting on the close of the day of entry.
You certainly do not want to be day-trading with this
trend-following technique! Notice the high accuracy rates of 85 to
90% when the trade is held 20 days or more. For instance, if you
exited each trade on the 22nd close, you would make $54,800 with a
91% accuracy rate and a drawdown of less than $5,500! And this is
accomplished without any stop! We can conclude that this entry
technique predicts,with almost 85 to 90 percent accuracy, a
resumption of the trend that lasts between 20 to 25 days
Table 3. Results of the Entry Technique and Exiting on Xth Close.
X NetPrft AvgTrd PFact MaxDD
#Trds %Prft
1.00 -412.50 -5.81 .96 -3900.00 71
45
2.00 2506.25 36.32 1.15 -4243.75 69
51
3.00 3231.25 51.29 1.18 -5493.75 63
52
4.00 9562.50 173.86 1.75 -4781.25
55 64
5.00 14925.00 287.02 2.30 -4043.75 52 63
6.00 21343.75 426.88 3.21 -3518.75 50 66
7.00 24650.00 535.87 3.05 -4056.25 46 65
8.00 31350.00 712.50 3.77 -3650.00 44 73
9.00 22481.25 522.82 2.73 -4212.50 43 60
10.00 21325.00 495.93 2.49 -5337.50 43
58
11.00 21418.75 498.11 2.51 -6431.25 43
63
12.00 27868.75 679.73 3.34 -4687.50 41
66
13.00 24187.50 604.69 2.73 -6081.25 40
63
14.00 19731.25 519.24 2.04 -7181.25 38
58
15.00 20768.75 561.32 2.11 -7393.75 37
70
16.00 25737.50 695.61 2.58 -7050.00 37
68
17.00 37000.00 1057.14 4.49 -5468.75 35
71
18.00 40631.25 1195.04 4.75 -5468.75 34
74
19.00 46162.50 1357.72 6.23 -5468.75 34
79
20.00 52793.75 1599.81 7.52 -5468.75 33
85
21.00 57168.75 1732.39 8.29 -5468.75 33
85
22.00 54862.50 1714.45 7.92 -5468.75 32
91
23.00 56618.75 1826.41 9.00 -5468.75 31
90
24.00 53318.75 1838.58 8.27 -5468.75 29
90
25.00 56168.75 2006.03 7.45 -5468.75 28
86
26.00 54075.00 1931.25 6.01 -5468.75 28
79
27.00 52325.00 1868.75 6.45 -5468.75 28
79
28.00 51043.75 1822.99 6.83 -5468.75 28
75
29.00 47893.75 1773.84 5.92 -5468.75 27
78
30.00 47581.25 1762.27 6.38 -5468.75 27
78
The Exit Techniques
For the exits we have included a $2,500 money management stop, which
attempts to limit the worst possible loss sustainable on any
particular trade. We are always most comfortable trading with stops
that will limit the maximum dollar loss on any trade, although we
realize that this protection may be limited if the market gaps
against the position overnight. We have chosen $2,500 as the
dollar-stop in this system. This is a large stop designed to avoid
whipsaws, and it has only been hit once in the last 10 years. In
spite of the fact that this stop is rarely triggered we believe it
is essential and its presence makes us comfortable. We recommend
dollar stops on all systems to protect against catastrophic losses.
The second exit strategy is a common one: the channel low exit. In
this case we have chosen the low of the last 25 market days. Again,
the exact number of days is probably unimportant; the concept of
trailing a stop at a low point in the market is very popular and has
been used successfully by market technicians for a long time.
If we merely installed the $2,500 dollar stop and the 25-day channel
low exit, the system makes $43,000 over 10 years of trading, with 18
trades. The average bars in winners is 67, which is a relatively
long period, and the average bars in losers is 14, showing that the
trailing exit effectively cuts losses short and lets profits run.
The system is 67% accurate, and has a huge average trade of $2,400.
The ratio of average win to loss with this exit is 3.78.
While this variant of the system is profitable and tradable on its
own, it suffers from several disadvantages: Firstly, it holds trades
for a very long period. To take a profit on a winning trade, a
trader would have to hold through an average of 67 days. This may
not be psychologically appealing for many traders. But secondly, and
even worse, the exit is inefficient in that it frequently gives up
large amounts of open profits, since it always requires the market
to reverse to a 25-day low before signalling an exit. We have
frequently seen trades give up one-third, or half, or all of their
open profits before exiting a trade on a trailing channel stop. In
addition to suffering a "roller coaster" sensation while waiting for
a profitable trade to retrace to a 25-day low, many winning trades
could turn into losses because of the slow exit. This would not make
us comfortable in spite of the potential profits.
A simple “twist” to the exit strategy allows us to reduce the number
of days in the average holding period, increase total profits,
increase the accuracy to 72%, and trade more frequently. The
technique is this: we will wait patiently for a trade to develop
over a specific number of days, using the conventional dollar and
channel stops, and then switch to a tighter channel stop to effect a
quick exit. Specifically, we will install the 25-day channel low
exit for the first 25 days of a trade (count the day of entry as day
1), and on the 26th day, we will change the exit technique to a much
tighter stop at the lowest low of the last 2 days. This dramatic
hange will obviously trigger a more sensitive exit but will still
allow us to maintain our position in a fast moving market.
We must also remember that our goal in trading is most directly
related to the size of the profit and not to the average holding
period. Holding a trade longer may be best in most cases but not in
all. For those cases where we are fortunate enough to have a large
profit in less than 25 days we want to raise our stop to protect
those profits regardless of how long we have been in the trade. We
have defined a large profit as a profit of 5 average true ranges or
more. Once our open profit on a closing basis reaches this level we
will implement our 2 day low exit regardless of the number of days
in the trade.
The combination of the $2,500 dollar stop, the 25-day lowest low
stop, and the switch in exits after 25 days creates a unique exit
strategy which leads us to the name for this system.
Conclusion
This report has presented several profitable concepts for trading
Bonds, which we believe should be equally applicable in other
markets. For example, we have observed that minor variations of this
system work well in testing over data in T Notes and Swiss Francs.
We have shown the impact of a strong prevailing trend on winning
trades and recommend taking long trades only when the trend is
clearly and strongly up. In spite of the strong trend we have also
shown that it is more advantageous to wait for a decline in prices
during the uptrend in order to set up a high-probability entry
point. Also, we have shown how a simple adaptation of an age-old
exit technique can increase profitability and accuracy, while
reducing the average holding period per trade.
We hope that this system as well as all our systems will be
profitable in the future. There are no guarantees. Constructing
systems that perform well over past data is relatively easy once you
learn a few basic rules. But in addition to showing great
hypothetical performance, our goal is to develop systems that will
serve our club members as valuable learning tools and hopefully
produce reasonably good results over the unseen data in the future.
Please give us your comments and suggestions about this system and
other systems that you would like to see.
Aims of the System Traders Club
First, we do not hope to reveal any "holy grails" to trading. Many
of the systems that you will see in the System Club reports include
indicators that you may already be familiar with, or that can be
easily programmed into the computer. In addition, you will find that
many of these systems are not perfect: they will all have drawdowns,
and none of them are 100% accurate over the long run. However, we
think they deserve serious consideration for actual real-time
trading applications. We realize that in the business of trading the
futures markets there is no single method that makes money
automatically. We believe that a combination of logical system
concepts and reasonable entry and exit strategies greatly increases
the probability of success in trading. We hope to be able to
communicate to you, through these reports, many of the concepts that
we have learned over the years.
Second, we hope that these reports will serve both an informative as
well as a practical purpose. We will share with you lessons that we
have accumulated over the years regarding trading strategies and
techniques that have worked in various markets, and the logic behind
them. You may also want to view the systems presented as
illustrations of general principles and concepts in systematic
trading of the futures markets. We hope that you may also apply
these concepts to your own favorite markets and time-frames. We
would welcome any feedback you may have on possible improvements and
different applications of these systems.
Third, we intend to provide many different systems and market
combinations in our reports. Multiple systems can be combined
together in a portfolio to generate more frequent trades and higher
returns than any single system. We believe in diversification; but
we also realize that diversification is a function of personality
and preference. For this reason, we will be offering many different
types of systems, from which you will be able to select systems that
suit your personality and preference and combine them into your own
diversified trading portfolio.
******************************************************************
MetaStock Efficiency Issues
In order to implement the system several techniques were required
that slow performance considerably. Daily commentaries suffer the
most. On fast Pentium II processors the delays are bearable, but on
a 486 processor it may take 3-5 minutes to update a commentary.
System testing with a large data set requires a lot of patience. If
charts are limited to a year’s daily data (250 bars more or less),
delays will be minimized. Commentaries need only be enabled on setup
and actual trade days. Keep open charts to a minimum.
Overview of MetaStock implementation
The 25x25 Bond System enters and exits trades at intraday prices. In
order to create a MetaStock 6.50 version it was necessary to develop
several indicators to keep track of the intraday entry and exit
prices. While this sounds simple enough, MetaStock does not provide
global variables or allow circular procedure referencing which would
greatly simplify the task.
On top of these shortcomings, MetaStock imposes tremendous
processing overhead by not allowing variable assignments within
structured code. This means that all values that might be needed in
a procedure must be calculated ahead of time, whether required or
not, and are constantly updated when referencing previous values.
The 25x25 system only takes long trades. This MetaStock 6.50 system
is designed as a template for more complex systems taking both long
and short trades based on intraday prices and complex entry/exit
procedures.
The main indicator is “25x25 LongEntry” which returns the entry
price for a trade for each day in the trade. A zero value indicates
no position. The exit day is signaled by setting the entry price
negative. Thus, the value returned by a single fml(“25x25
LongEntry”) statement tells you the market position, the entry
price, and whether it’s the last day of a trade or not, and can be
used to calculate a trade’s open profit and days in the trade. This
indicator is the heart of the system. It should be carefully studied
to understand how it decides when to enter a trade and whether to
continue or exit the trade. It stands alone and the other indicators
depend on it.
The second indicator is “25x25 LongExit” which returns the exit
price when “25x25 LongEntry” returns a negative value. It simply
recalculates the exit stop value which triggered a “25x25 LongEntry”
negative value. The result is only used to determine a trade’s
closed profit. These two indicators may seem redundant for the 25x25
System, but the technique allows for more complex systems that may
stop and reverse on intraday prices. By building corresponding
“ShortEntry” and “ShortExit” indicators almost any system can be
modeled.
A third indicator, “25x25 TP”, returns the Trade Position and all
other variables needed by the MetaStock Expert. While not efficient,
the Expert allows the system to be traded without the need to plot
the indicators.
Since MetaStock’s System Tester does not handle intraday prices, it
can’t test the 25x25 performance. The “25x25 Equity” indicator
allows the user to plot an equity curve but, unfortunately, a trade
by trade report cannot be generated. This indicator is not required
by the system and should only be plotted when testing.
The “25x25 Stop” indicator is another stand alone indicator not
required by the system but which is very helpful in seeing the stop
values while in a trade. Unlike the other indicators, which should
be plotted in separate windows, the “25x25 Stop” can be plotted
directly on the daily bar chart. It should be plotted as a dashed
line. Note that stop values for days with no trade position are
plotted as the days’ low value just to keep the chart properly
scaled.
Discrepancies between MetaStock and TradeStation Results
MetaStock and TradeStation do not compute several indicators exactly
the same. In order to duplicate the TradeStation design as closely
as possible, the following MetaStock indicators were modified:
Relative Strength Index (RSI(4)) results are rounded to two decimal
places with the following code: PREC(RSI(4) + .005, 2)
Average True Range(ATR(45)) smoothing is removed with the following
code: Mov(ATR(1), 45, S)
Even with these modifications not all 25x25 trades are exactly
matched. However, they are very close. MetaStock’s ten year test
equity is $51,556.27 compared to TradeStation’s $53,068.75.
*********************************************************************************
{METASTOCK CODE}
{Chuck Le Beau's System Trader's Club}
{ http://traderclub.com }
{ mailto:chuck@traderclub.com }
{"25 x 25" Bond System MetaStock format}
{25X25 LongEntry}
{Returns long trade entry price. }
{A non-zero number if in a long trade. }
{A negative value if the last day of a trade. }
{Note: Modifications to MetaStock indicators }
{were req'd to simulate TradeStation results }
{ RSI: rounded to two decimal places }
{ ATR: Wilder's smoothing removed }
{Variables to avoid duplicate function calls }
PLLV2 := Ref(LLV(L,2),-1);
PLLV25 := Ref(LLV(L,25),-1);
{ Was yesterday a setup day? }
IsSetUp :=
Cum(1) > 50 AND
Ref(PDI(14),-1) > Ref(MDI(14),-1) AND
Ref(ADX(14),-1) > 20 AND
PREC(Ref(RSI(4),-1)+.005,2) < 50;
{Determine initial entry price condition}
EntryPriceCond := Ref(C,-1) + 0.5625;
{Adjust it to enter on open if open is greater}
EntryPriceCond :=
If(O > EntryPriceCond, O, EntryPriceCond);
{Return entry price, zero if no trade. }
If(PREV <= 0,
{Not in a long trade}
If(IsSetUp AND H >= EntryPriceCond,
{Trade entered today, was it stopped?}
If(L <= PLLV25 OR
L <= EntryPriceCond - 2.5,
-EntryPriceCond, {Yes}
EntryPriceCond {No}
),
{Not in trade and not entered today}
0
),
{Have been in trade for over one day. }
{Was it stopped today? }
{Note: BarsSince() gives days in trade }
If(L <= PREV - 2.5, - PREV,
If(BarsSince(PREV=0) > 24,
{More than 24 days in trade}
If(L <= PLLV2, -PREV, PREV),
{Less than 25 days in trade}
If(L <= PLLV25, -PREV,
If(Ref(C,-1) - PREV >
5*Ref(Mov(ATR(1),45,S),-1),
If(L <= PLLV2, -PREV, PREV),
PREV
)
)
)
)
);
25x25 Long Exit
{Returns exit price if last day of long trade}
EntryPrice := Fml("25x25 LongEntry");
ExitingTrade := EntryPrice < 0;
EntryPrice := Abs(EntryPrice);
{Variables to avoid duplicate function calls }
{Lowest low of previous two days }
PLLV2 := Ref(LLV(L,2),-1);
{Lowest low of previous 25 days }
PLLV25 := Ref(LLV(L,25),-1);
TradeDays := If(EntryPrice > 0,
BarsSince(Fml("25x25 LongEntry") = 0), 0);
{ Determine type of stop(s) }
Stop1 :=
ExitingTrade AND TradeDays>24 AND L<=PLLV2;
Stop2 :=
ExitingTrade AND TradeDays>0 AND TradeDays<=24 AND L<=PLLV25;
Stop3 :=
ExitingTrade AND L <= EntryPrice - 2.5;
Stop4 :=
ExitingTrade AND Ref(C,-1) - EntryPrice > 5*Ref(Mov(ATR(1),45,S),-1)
AND L <= PLLV2;
{ Determine prices for activated stops }
Stop1Price :=
If(Stop1, Min(O, PLLV2), 0);
Stop2Price :=
If(Stop2, Min(O, PLLV25), 0);
Stop3Price :=
If(Stop3, Min(O, EntryPrice - 2.5), 0);
Stop4Price :=
If(Stop4, Min(O, PLLV2), 0);
{ Assume best stop price stopped the trade }
StopPrice :=
Max(Stop1Price,Max(Stop2Price,
Max(Stop3Price,Stop4Price)));
If(ExitingTrade, StopPrice, 0);
25x25 TP
{ Calculate today's trade position and other }
{ values used by the expert. }
{ LE = LongEntryPrice from indicator }
{ SULE = Tommorow's LongEntry if setup day }
{ SULS = Tommorow's LongStop if setup day }
{ TP = TradePosition +1,0 }
{ TLS = Tomorrow's LongStop if in trade }
{ PRFT = Trade Profit }
{ RISK = Tommorow's theoretical capital risk }
LE := Fml("25x25 LongEntry");
TP := If(LE <> 0, +1, 0);
PRFT := If(LE = 0, 0,
If(LE > 0, C - LE,
Fml("25x25 LongExit") + LE));
TradeDays := If(LE <> 0,
BarsSince(Fml("25x25 LongEntry") = 0), 0);
{Calculate tomorrow's entry prices }
SULE :=
If(TP = 0,
If(PDI(14) > MDI(14) AND ADX(14) > 20 AND
PREC(RSI(4)+.005,2) < 50,
C + .5625, 0), 0);
{Calculate initial stop price}
SULS :=
If(SULE <> 0, Max(LLV(L,25), SULE-2.5), 0);
{Calculate tomorrow's stops }
S1 := If(LE > 0,
If(TradeDays >= 24,
LLV(L,2),
LLV(L,25)), 0);
S2 := If(LE > 0, LE - 2.5, 0);
S3 := If(LE > 0 AND
PRFT >= 5*Ref(Mov(ATR(1),45,S),-1),
LLV(L,2), 0);
{Tomorrow's Long Stop}
TLS := Max(S1, Max(S2, S3));
PRFT := PRFT * 1000;
RISK :=
If(LE > 0, (LE-TLS)*1000,
If(SULE <> 0, (SULE-SULS)*1000, 0));
TP;
The following Trade by Trade Report was produced using the data
supplied with this archive
which is continuous contract, back-adjusted, day session only, Bond
futures data.
Bond "25" System UA.LNG-Daily 01/04/88 - 01/16/98
Date Time Type Cnts Price Signal Name Entry P/L
Cumulative
06/22/88 Buy 1 64^10
07/13/88 LExit 1 62^22 L25 $ -1725.00 $
-1725.00
09/29/88 Buy 1 64^24
11/04/88 LExit 1 67^10 $ 2462.50 $ 737.50
05/05/89 Buy 1 67^23
06/15/89 LExit 1 73^13 $ 5587.50 $ 6325.00
06/20/89 Buy 1 73^14
08/03/89 LExit 1 77^21 $ 4118.75 $ 10443.75
08/15/89 Buy 1 74^12
08/22/89 LExit 1 73^24 L25 $ -725.00 $
9718.75
08/23/89 Buy 1 74^08
08/29/89 LExit 1 73^17 L25 $ -818.75 $
8900.00
10/19/89 Buy 1 76^14
11/27/89 LExit 1 77^01 $ 493.75 $ 9393.75
06/26/90 Buy 1 71^13
07/10/90 LExit 1 70^27 L25 $ -662.50 $
8731.25
11/09/90 Buy 1 70^14
12/17/90 LExit 1 74^23 $ 4181.25 $ 12912.50
08/28/91 Buy 1 77^31
10/03/91 LExit 1 80^22 $ 2618.75 $ 15531.25
11/06/91 Buy 1 80^05
12/13/91 LExit 1 82^05 $ 1900.00 $ 17431.25
01/17/92 Buy 1 84^16
01/29/92 LExit 1 83^07 L25 $ -1381.25 $
16050.00
05/29/92 Buy 1 83^25
07/08/92 LExit 1 86^13 $ 2525.00 $ 18575.00
07/15/92 Buy 1 86^17
08/21/92 LExit 1 89^22 $ 3056.25 $ 21631.25
12/29/92 Buy 1 91^18
02/10/93 LExit 1 93^31 $ 2306.25 $ 23937.50
02/11/93 Buy 1 93^31
03/22/93 LExit 1 97^17 $ 3462.50 $ 27400.00
08/09/93 Buy 1 104^20
09/15/93 LExit 1 108^25 $ 4056.25 $
31456.25
12/13/94 Buy 1 94^05
01/20/95 LExit 1 94^15 $ 212.50 $ 31668.75
02/10/95 Buy 1 97^04
03/21/95 LExit 1 99^06 $ 1962.50 $ 33631.25
03/24/95 Buy 1 99^02
05/11/95 LExit 1 104^04 $ 4962.50 $
38593.75
06/13/95 Buy 1 108^18
07/19/95 LExit 1 107^31 $ -693.75 $
37900.00
09/19/95 Buy 1 110^13
10/27/95 LExit 1 112^05 $ 1650.00 $
39550.00
10/27/95 Buy 1 112^31
12/07/95 LExit 1 116^16 $ 3431.25 $
42981.25
08/16/96 Buy 1 108^22
08/26/96 LExit 1 106^06MM $ -2600.00 $
40381.25
10/11/96 Buy 1 108^17
11/25/96 LExit 1 113^02 $ 4431.25 $
44812.50
05/08/97 Buy 1 108^21
06/18/97 LExit 1 110^22 $ 1931.25 $
46743.75
06/27/97 Buy 1 110^28
08/04/97 LExit 1 113^28 $ 2900.00 $
49643.75
09/26/97 Buy 1 115^14
11/03/97 LExit 1 117^05 $ 1618.75 $
51262.50
11/06/97 Buy 1 117^15
12/17/97 LExit 1 119^12 $ 1806.25 $
53068.75
12/31/97 Buy 1 120^05
To view an equity chart based on the above trades go to:
http://www.traderclub.com/systems_25.htm
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS.
HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT
LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS
DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT
ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER
COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS SUCH
AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO
SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF
HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR
IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. |