Documente Academic
Documente Profesional
Documente Cultură
120 15⁄16
120
115
{
{ 60
well as provide the opportunity for early
entry into the position.
Narrow range
50 Figure 3 shows the formation of a
wide trading range in Oracle (ORCL) at
the beginning of this year. A trader look-
40
ing to enter long on an upside breakout
of this range would have to accept a risk
30 of more than 16 points, assuming the
bottom of the range was used for the ini-
tial stop-loss.
4 11 18 25 1 8 15 22 29 6 13 20 27 3 10 18 24 31 7 14 22 29 6 13 20 27 3 10 17 24 1 8 15 However, a much narrower trading
Oct. Nov. Dec. Jan. 2000 Feb. Mar. Apr. May range developed in February. Using this
Source: Qcharts by Quote.com range as the basis of an upside breakout
trade would have offered the same entry
Resistance
trading ranges,
80
triangles, flags
Flag
70 and pennants is that
60
these formations
allow you to clearly
50
define the risk on
40
your trades.
30 point but a much closer stop. In this
27 4 11 18 25 1 8 15 29 6 13 27 3 10 24 31 7 14 28 6 13 20 27 3 10 24 1 8 15 22 30 5 12 19 26 3 10 17 24 31 7 case, placing a stop one tick below the
Oct. Nov. Dec. Jan. 2000 Feb. Mar. Apr. May June July Aug. low of the narrower trading range
Source: Qcharts by Quote.com would have reduced the risk to 6 3⁄4
points. For a short-term trader, this rep-
resents a large stop, but it’s still a dra-
FIGURE 5 NARROW FLAG matic improvement and the profit
A narrow flag consolidation forms near the resistance level of an intraday potential for the move out of the larger
head-and-shoulders bottom pattern. The low of the flag provides a lower-risk trading range is still intact. (Later, we’ll
stop level than the most recent swing low. look at the practical risk-reward impact
this can have on a trade.)
Nasdaq 100 Index (QQQ), 15-minute Figure 4 provides another example. In
93 3⁄8
this case, EMC Corp. (EMC) repeatedly
92 pulled back from resistance around 72 1⁄2.
Because a well-defined horizontal trad-
Resistance ing range did not develop (the stock
88 swung back and forth in an increasingly
wider range), the most recent swing low
around 51 would be the reference point
84 for the initial stop-loss — a risk of more
than 20 points.
Narrow However, as the stock bounced off that
flag low and made another run at the resist-
80
ance level, it formed a flag consolidation
from June 7 to June 12 with a high around
69 7⁄8 (the highs of the bars in the flags
76 were within 1⁄16 of each other) and a low
S S
around 66 13⁄16. The upside breakout of this
flag provided an early entry to the subse-
H quent surge that pushed the stock past
19 22 23 24 25 26 30 31 1 2 the 72 1⁄2 resistance level to new highs.
May June
Figure 5 shows a 15-minute chart of
Source: Qcharts by Quote.com the Nasdaq 100 tracking stock (QQQ).
The stock formed a large bottoming pat-
Anticipating BREAKOUTS
and beating SLIPPAGE
Trading breakouts is a tried-and-true
of slippage.
A sampling of the breakout patterns short-term traders can use on any time
frame. They provide well-defined support or resistance levels you can use to
anticipate breakouts.
122 1⁄4, well before the 123 1⁄16 breakout breakouts to materialize on any of these
point. Not long after, the overall market patterns. Remember, slippage affects
strength helped pull WLA through the you whether or not you make a profit on
trendline; it continued to rally for the the trade. Most traders don’t even think
rest of the day. about the effect of slippage on their win-
Had you waited for WLA to print at ning trades; they only think about the
123 1⁄16, you would have been filled at a losers. And don’t forget about the trades
minimum of 13⁄16 worse than the early you missed completely because the
entry price. Those extra fractions add up stock just ripped through the support or
quickly. You can usually gain an extra 1⁄8 resistance level and you couldn’t even
(sometimes as much as a point) simply get a partial fill.
by realizing that support and resistance We tend to forget about those missed
almost always get broken. Try the fol- opportunities completely, but those are
lowing experiment: Multiply 50 percent usually the most potentially profitable
of all the shares you have traded over a trades because the stock is moving so
given time period by 1⁄8 and see what you forcefully. This approach will also help
come up with. That’s being conservative. you on the breakout trades that don’t
You can use this entry technique on materialize because you’ll have a better
any breakout-related trade in any time- entry price and may even be able to still
frame, including breakouts from daily garner a small profit or, at worst, scratch
and intraday cup-and-handle patterns, a trade from these false breakouts.
triangles, trendline breakouts and spike No approach is without risk, but in
and ledge patterns (see Figure 4). Very certain situations entering early can
rarely should you wait for the actual yield excellent trading results.
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
2,000,000
The $5,000 maximum loss this five-contract
trade represents should not be more than 2 per-
1,800,000
cent of the current portfolio equity. As a result,
1,600,000 unless the account equity is in excess of $250,000,
1,400,000 the system would not be able to take this position.
1,200,000
Starting equity: $100,000. Deduct $10 slip-
1,000,000
page/commission per trade.
800,000
600,000 Test data: The system was tested on the Active
400,000 Trader standard futures portfolio, which contains
the following 20 futures: DAX30 (AX), corn (C),
200,000
crude oil (CL), German bund (DT), Eurodollar
0 (ED), Euro Forex (FX), gold (GC), copper (HG),
Japanese yen (JY), coffee (KC), live cattle (LC),
3/25/93 3/1/94 2/2/95 2/1/96 1/8/97 1/2/98 1/4/99 1/3/00 1/2/01 1/2/02
lean hogs (LH), Nasdaq 100 (ND), natural gas
Equity Cash Linear reg Long Short (NG), soybeans (S), sugar (SB), silver (SI), S&P 500
LEGEND: Net profit — profit at end of test period, less commission • Annually 8.58% 0.58 29.99% -8.91% 66.67% 3 2
Exposure — the area of the equity curve exposed to long or short positions, as
opposed to cash • Profit factor — gross profit divided by gross loss • Payoff LEGEND: Avg. return — the average percentage for the period • Sharpe
ratio — average profit of winning trades divided by average loss of losing ratio — average return divided by standard deviation of returns (annualized)
trades • Recovery factor — net profit divided by max. drawdown • Max DD • Best return — best return for the period • Worst return — worst return
(%) — largest percentage decline in equity • Longest flat days — longest for the period • % Profitable periods — the percentage of periods that were
period, in days, the system is between two equity highs • No. trades — num- profitable • Max. consec. profitable — the largest number of consecutive
ber of trades generated by the system • Win/Loss (%) — the percentage of profitable periods • Max. consec. unprofitable — the largest number of
trades that were profitable • Avg. gain — the average profit for all trades • consecutive unprofitable periods
Avg. hold time — the average holding period for all trades • Avg. gain
Trading System Lab strategies are tested on a portfolio basis (unless
(winners) — the average profit for winning trades • Avg. hold time (win-
ners) — the average holding time for winning trades • Avg. loss (losers) — otherwise noted) using Wealth-Lab Inc.’s testing platform.
the average loss for losing trades • Avg. hold time (losers) — the average If you have a system you’d like to see tested, please send the trad-
holding time for losing trades • Max. consec. win/loss — the maximum ing and money-management rules to editorial@activetradermag.com.
number of consecutive winning and losing trades
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
4,000
Short trades: Sell short if the closing price of
the third 30-minute bar is below the low of the 2,000
first 60 minutes of the day. 0
10/15/01 1/8/02 4/1/02 6/24/02 9/23/02 12/30/02 4/2/03 6/26/03 9/25/03
Exit: Exit all positions on signals in the
opposite direction or at the end of the day. Equity Cash Long Short Buy & hold
Money management: To equalize the weight of Source for all figures: Wealth-Lab Inc. (www.wealth-lab.com)
Test data: SPY and QQQ. The SPY is designed 10/15/01 1/2/02 3/14/02 5/30/02 8/9/02 10/28/02 1/21/03 4/2/03 6/13/03 8/29/03
to trade at one-tenth the level of the S&P 500;
the QQQ is designed to trade at one-fortieth of the Nasdaq 100. close all positions not triggered by an opposite signal at the
Like futures, the uptick rule to enter short positions does not close of the day.
apply to these instruments. QQQ and SPY can be traded intra-
day but have the advantage that no rollover occurs every three Test results: The results for the two years are very encourag-
months. ing: a profit of 19.88 percent on the starting capital in two
We downloaded more than two years of 30-minute bars from years, compared to an unchanged result for the combined
the QCharts historical intraday database for SPY and QQQ. equities of the two indices (see Figure 1).
There are a few interesting things to note. For the first hour The system generated its largest drawdown (-13.52 per-
range we take the prices from 9:30 a.m. to 10:30 a.m. and for the cent) on Feb. 21, 2002 (see Figure 2). Buy and hold’s largest
closing time we use 4:15 p.m. This is important because we will drawdown (on Oct. 9, 2002) was -44.87 percent.
150,000
Test data: The system was initially tested only on the 140,000
130,000
QQQ. It was also tested on the Active Trader Standard 120,000
Stock Portfolio, which contains the following 18 110,000
stocks: Apple Computers (AAPL), Boeing (BA), 100,000
90,000
Citigroup (C), Caterpillar (CAT), Cisco Systems 80,000
(CSCO), Disney (DIS), General Motors (GM), Hewlett- 70,000
Packard (HPQ), International Business Machines 60,000
50,000
(IBM), Intel (INTC), International Paper (IP), J.P. 40,000
Morgan Chase (JPM), Coca-Cola (KO), Microsoft 30,000
(MSFT), Sears (S), Starbucks (SBUX), AT&T (T) and 20,000
10,000
Wal-Mart (WMT). 0
3/10/99 9/1/99 3/1/00 9/1/00 3/1/01 9/4/01 3/8/02 9/5/02 3/6/03 9/3/03 3/3/04
Test period: March 1999 through June 2004 for the
Equity Cash
QQQ test; July 1994 to June 2004 for the Active Trader
portfolio.
Drawdown
-4%
Test results: Figure 1 shows the first trade was a suc- -5%
cess. Price rose 40 cents after entry and the market -6%
made a small gap open the following day for a two- -7%
percent profit. The next two trades, which occurred -8%
only a few days later, were not as successful but -9%
nonetheless booked modest profit. -10%
However, the next trade wiped out the previous -11%
profit and then some. Price gapped up at the market 3/10/99 9/1/99 3/2/00 9/1/00 3/5/01 9/4/01 3/8/02 9/6/02 3/7/03 9/5/03 3/5/04
open, beyond the four-percent threshold, and the
entry order was filled (this particular trade would
have probably been subject to negative slippage because of the the designers knew of previous QQQ price movement), it was
volatility at the open). tested on other markets in an attempt to determine its validity.
Price then suddenly reversed, and the result was a large loss Our starting equity for the Active Trader portfolio test was
upon the exit the following day. The fact that the initial losing also $100,000, although only 10 percent of equity was commit-
trade occurred on a day when prices gapped above the entry ted per trade.
level on the open suggests the system might benefit from a fil- This equity curve (Figure 4, p. 60) shows fairly steady
ter that ignores the signal if price opens with a greater than growth from the beginning of the test period through mid-
four-percent gain. 2002. From that point, there is a slight decline in capital and a
The equity curve (Figure 2) provides a better indication of general stagnation as fewer trades take place.
the system’s overall performance. After a small loss in 1999, This equity curve mirrors the QQQ equity curve. However,
profits began in early 2000 and lasted until mid- to late 2002. the fact that the system was profitable on a portfolio of stocks
The drawdown curve (Figure 3) confirms this, as the 12-per- (8.95 percent annualized gain) and not just one stock is evi-
cent drawdown began in late 2002. The system is more or less dence the system is based on a valid core assumption.
flat from April 2003 forward. The only trade after that was in
July 2003, resulting in a loss of 0.08 percent. System variation: James Altucher publishes a variation of the
system that adds one additional entry rule: Price must be down
Portfolio test results: While it is still too early to tell if this sys- two percent on the day before entering a trade. This rule is
tem is worth trading on the QQQ (because it’s possible the sys- intended to avoid entering when a price move is nearly
tem was subconsciously designed to take advantage of what exhausted, and allows the system to capture solid rebound
LEGEND: Net profit — Profit at end of test period, less commission • Exposure LEGEND: Avg. return — The average percentage for the period • Sharpe ratio —
— The area of the equity curve exposed to long or short positions, as opposed to cash Average return divided by standard deviation of returns (annualized) • Best return
• Profit factor — Gross profit divided by gross loss • Payoff ratio — Average — Best return for the period • Worst return — Worst return for the period •
profit of winning trades divided by average loss of losing trades • Recovery factor Percentage profitable periods — The percentage of periods that were profitable •
— Net profit divided by max. drawdown • Max. DD (%) — Largest percentage Max. consec. profitable — The largest number of consecutive profitable periods •
decline in equity • Longest flat days — Longest period, in days, the system is Max. consec. unprofitable — The largest number of consecutive unprofitable periods
between two equity highs • No. trades — Number of trades generated by the sys-
tem • Win/Loss (%) — the percentage of trades that were profitable • Avg. trade
— The average profit/loss for all trades • Avg. winner — The average profit for Trading System Lab strategies are tested on a portfolio basis (unless
winning trades • Avg. loser — The average loss for losing trades • Avg. hold time otherwise noted) using Wealth-Lab Inc.’s testing platform.
— The average holding period for all trades •Avg. hold time (winners) — The
If you have a system you’d like to see tested, please send the
average holding time for winning trades • Avg. hold time (losers) — The aver-
age holding time for losing trades • Max. consec. win/loss — The maximum trading and money-management rules to editorial@activetradermag.com.
number of consecutive winning and losing trades
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
BROADENING PATTERNS:
Clues to breakout direction
A partial rise or decline can predict the direction of a breakout.
Learn to use these signals to increase profits when trading broadening patterns.
BY THOMAS N. BULKOWSKI
BY THOMAS N. BULKOWSKI
A
is not over.
high, tight flag (HTF) is a
consolidation pattern that
forms after a stock’s price
doubles. When price breaks
out above the pattern, it signals the rise
Flag criteria
What should you look for when select-
ing HTFs? That depends on whom you
ask. William O’Neil, who popularized
that formed in January-February 2000. the pattern, has several selection criteria
The uptrend started in October at a low (see “Additional reading,” p. 33). He has
of 5.50 and reached a high of 11.35 at the written the rally preceding the pattern
HTF’s starting point — a doubling of should measure 100 to 120 percent and
price in less than a month. take less than two months; the flag
Although many HTFs have irregular should move sideways for three to five
shapes, you can usually draw a trendline weeks. Finally, the flag should retrace no
along the top of the pattern to signal a more than 20 percent of the preceding
breakout. In this example, parallel trend- rally.
lines mark the flag’s upper and lower Applying these rules to 252 patterns
boundaries. Volume slopes downward found in price data of approximately 500
over the course of the flag, as it did in 90 stocks between mid-1991 and early 2004
percent of HTFs in a recent study. filtered out all of them! (An earlier study
The basic HTF trade strategy is to buy found only six of 81 patterns met his crite-
at the close of the day after price breaks ria; these patterns did, however, produce
out above the pattern’s upper trendline. average gains of 69 percent.) The flag
In Figure 1, the stock rallied 52 percent shown in Figure 1 actually does not meet
from the closing price the day after price O’Neil’s criteria because it retraced 52
pierced the HTF’s upper trendline to the percent of the prior rise (most flags failed
ultimate high. O’Neil’s filter because they retraced more
Although it is sometimes difficult to than 20 percent) and the flag duration
buy high and sell higher, the price lasted more than seven weeks .
This pattern does not meet William O’Neil’s HTF criteria, but the post-breakout rise was
52 percent. Such a well-defined flag shape is unusual.
Mastering
TWO-MINUTE breakouts
How can you find consistent trade opportunities?
One way is to trade breakouts through yesterday’s high and low —
but only after the stock has shown its true colors.
trade is to buy upside or downside stock, you can ride the coattails of the
breakouts of the previous day’s high or large money on the way up. To make
low, respectively, avoiding trades in the sure, however, don’t enter the trade until
middle of the day’s range. We’ll show the stock also has cleared the required
how to apply this technique using two- noise level.
minute charts. We also use the time and sales win-
dow to confirm that any large block
The tools trades are going our way and that most
For this approach, use a two-minute can- trades are executed at the ask price for
dlestick chart encompassing a two-day long trades, or the bid price for short
time horizon (today and yesterday). For sales. It also is good if a directional chart
a long trade, buy the stock once it has pattern — i.e., one that implies a move
cleared the whole number closest to the either up or down — confirms the break-
BY KEN CALHOUN previous day’s high. out. A simple example is successive clos-
For example, assume a stock made a es at the high (or low) of the price bars
high of 47.9 yesterday. In this case, you leading up to, or coinciding with, the
I
would enter a buy order when the stock breakout. Also, many traders use specif-
t is often a struggle to find the hits 48.5 (having cleared 48, the nearest ic candlestick chart patterns to indicate
most appropriate indicator for a whole number) and when time and likely price direction.
given trading situation. A tool sales shows that most trades are being
that works in one environment executed at the ask price, which would The rules
may not be appropriate in another. suggest strong demand for the stock. The best time to use this method is the
Momentum oscillators or the Nasdaq Reverse the logic for short trades. profitable and volatile 9:40 a.m. to 11
and S&P 500 futures may provide early The reason for placing the entry a cer- a.m. (EST) time period. Trades typically
signals of shifts in the stock market, but tain amount above the previous day’s last several to 20 minutes. Here are step-
these tools also are often unreliable. high — in this case, 48.5 — is to make by-step guidelines for applying this
Moving average crossovers provide sure the trade safely “clears the hurdle”
trend confirmation but generally lag of the previous day’s trading range,
price action, and you cannot count on accounting for any market noise that
Strategy snapshot
sustained trends in consolidating mar- may be present. We don’t want to buy a Strategy: “Two-day” breakout
kets. Further, market makers frequently double top, we want to buy a breakout Market: Stocks
disguise their intentions via Electronic above the previous day’s high. Entering
Communications Networks (ECNs) or 0.3 to 0.5 above the whole number helps Entry: Go long (short) on move
Level II head fakes, which render the avoid false breakouts. .3 to .5-points above (below) whole
Level II screen more or less useless. So, This approach works because many number closest to previous day’s high
what’s a trader to do? professional traders and institutional (low).
Watch price action. Trading breakouts buyers buy such breakouts. In addition, Exit: Exit with trailing stop or on close.
and breakdowns of chart patterns is a some institutional buy programs also Risk control: Stop-loss of no more than
reliable and simple trading technique factor in the open, high, low and closing 0.4 points. Trail stop at this interval
that can help you limit risk. A relatively prices. When such programs trigger buy if market moves in direction of trade.
consistent short-term, pattern-based signals and money starts flowing into a
BY KEN CALHOUN
2,500,000
Volatility breakout system
ST = AC * PR / R
where 44.00
AC = Available capital
PR = Percent risked
R = Distance between entry 42.00
price and exit price (stop-loss).
Test period: November 1992 to February March April May June July
June 2002. Source: Omega Research ProSuite
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
P
can improve the performance
rice trends begin with a breakout of a previous
high or previous low. Unfortunately, many break- of intraday breakout trading.
outs are random — mere market noise. False
moves and reversals can repeatedly whipsaw
traders who act immediately on typical breakout signals. In the tests that illustrate this strategy, we’ll use five-minute
As a result, traders sometimes attempt to use filters to bars of IBM from Feb. 21 to April 6. (For an important point on
improve the odds of catching a successful breakout trend. One testing stock trading strategies, see “A note on price data and
example of a simple filter is to wait for consecutive closes dividends,” p. 75). Intraday data has a high noise level, mean-
above or below a breakout level. Another example is waiting ing it contains a great deal of random price movement that
for price to penetrate a breakout level by x percent or points looks significant but turns out to be meaningless. Without
before acting on the signal. some kind of filter, the losses generated by the random price
The following discussion will analyze a variation on the movement (that is, whipsaws) can completely overwhelm a
simple channel breakout system that uses the latter type of fil- trading system. To help eliminate such random movement, we
ter to minimize whipsaws on an intraday basis. The strategy will add a noise filter, designated by the symbol f, to the basic
will be tested on International Business Machines (IBM). The channel breakout system.
discussion is broken into two parts, covering 1) the system There are three system parameters to find:
rules and data selection and 2) testing procedures. This will • nhi, which is the number of bars in the lookback period
give you the necessary tools for performing similar research used to determine the highest high price (hhp).
and tests on other markets. • nlo, which is the number of bars in the lookback period
used to determine the lowest low price (llp).
The noise channel breakout system • f, which is the amount price must exceed the hhp or llp to
The basic system we will use here is a fairly simple and effec- trigger a buy or sell.
tive breakout system that has been in the public domain for
many years: the channel breakout system, which goes long on The rules for the resulting noise channel breakout system
a move above the highest high of the last n bars and goes short (NCBS) are:
on a move below the lowest low of the last n bars. Buy rule: If price crosses above the highest high of the last n
bars (nhi) by an amount greater than or stable — i.e., the TABLE 1 OPTIMUM PARAMETER VALUES FOR TEST DATA
equal to f, buy at market. For example, if profits, wins and
n = 20 and f = 2 (points), you would go drawdowns should
long when price moved 2 points above not change much as Start date End date nhi nlo f
the highest high of the last 20 bars. the parameters move
In addition, when short, and when by a small amount 2/21/01 3/23/01 8 4 1
calculating the highest high price (hhp), away from their opti-
it cannot be higher than the previously mum values. In other 2/28/01 3/30/01 8 4 1
calculated hhp as previous highs are words, the system
dropped out of the lookback window.
Otherwise, a situation can occur where TABLE 2A TEST PERIOD 1
there is a higher hhp without the price
Performance summary for noise channel breakout system: IBM, five-minute
filter f being hit. Therefore, when short
bars from Feb. 21 to March 23. Statistics based upon trading 1,000 shares of
the stock, the hhp can only stay the same
IBM.
or go lower. It cannot go higher.
Sell rule: If price crosses below the Performance summary: All trades
lowest low price of last n bars (nlo) Total net profit ($): 13,890 Open position P/L ($): 0
minus an amount greater than or equal
Gross profit ($): 39,260 Gross loss ($): -25,370
to f, sell at market. In addition, when
long and when calculating the lowest Total no. of trades: 48 Percent profitable (%): 54
low price (llp), it cannot be lower than Number winning trades: 26 Number losing trades: 22
the previous calculated llp as previous Largest winning trade ($): 5,940 Largest losing trade ($): -2,060
lows are dropped out of the lookback
window. Again, to avoid the situation Average winning trade ($): 1,510 Average losing trade ($): -1,153.18
where a lower llp occurs without the Ratio avg. win/avg. loss: 1.309 Avg. trade(win & loss) ($): 289.38
price filter f being hit, when long the Max. consec. winners: 4 Max. consec. losers: 3
stock, the llp can only stay the same or
Avg. no. bars in winners: 39 Avg. no. bars in losers: 21
go higher. It cannot go lower.
Exit rule: Close the position five min- Max intraday drawdown ($): -8,470
utes before the NYSE close (no trades are Profit factor: 1.547 Max. no. contracts held: 1
carried overnight).
TABLE 2B TEST PERIOD 2
Testing the strategy
The “walk-forward testing” approach Performance summary for noise channel breakout system: IBM, five-minute
will be used to test this strategy because bars from Feb. 28 to March 30. Statistics based upon trading 1,000 shares
of the volatile nature of intraday stock of IBM.
prices. Intraday price dynamics are con-
stantly changing because of economic Performance summary: All trades
surprises, events and trader sentiment. Total net profit ($): 10,490 Open position P/L ($): 0
Also, the time of year — such as the sea- Gross profit ($): 35,500 Gross loss ($): -25,010
son, holidays, vacation time, etc. —
Total no. of trades: 47 Percent profitable (%): 47
affects the character of intraday markets.
As a result, tests performed on intraday Number winning trades: 22 Number losing trades: 25
data three months ago may no longer be Largest winning trade ($): 5,940 Largest losing trade ($): -1,840
representative of today’s intraday price Average winning trade ($): 1,613.64 Average losing trade ($): -1,000.40
action. For more information on walk-
Ratio avg. win/avg. loss: 1.613 Avg. trade(win & loss) ($): 223.191
forward testing and how it was used for
this strategy, see “Proper system test- Max. consec. winners: 3 Max. consec. losers: 3
ing,.” Avg. no. bars in winners: 39 Avg. no. bars in losers: 26
The best parameters will be defined as
Max. intraday drawdown ($): -9,660
those values that generate the best net
profits combined with the minimum Profit factor: 1.419 Max. no. contracts held: 1
drawdown and minimum largest losing Source: TradeStation by TradeStation Group Inc.
trades. In addition, the results should be
A n overlooked aspect of testing a stock trading strategy is the effect of March 23 and Feb. 28 to March 30.
dividends. For example, IBM pays dividends on a quarterly basis, usu- Figure 1 is a five-minute chart with
ally on the “dividend payable dates” of March 10, June 10, Sept. 10 the noise channel superimposed, as well
and Dec. 10. On the “Ex-dividend dates” (approximately one month before as some of the buy and sell signals from
the payable date), the price of the stock is adjusted down by the value of the the Table 4 trade-by-trade summary.
dividend.
Thus, over the course of a year, IBM has a small downward price bias equal Breaking down the numbers
to the amount of the yearly dividend. If you were an owner of IBM, you would With respect to average winning and los-
receive those dividends in cash, making up for the small downward bias. ing trades, drawdowns and profit factor,
However, when developing and testing a system using historical stock data, the out-of-sample performance (Table 3)
prices are not adjusted for dividend payments. This creates a small distortion was better than the test sample perform-
in parameter selection and forward-adjusted results. ance (Tables 2a and 2b) The better per-
Because no dividends were paid in the data sample used for the test in this formance of the out-of-sample section
article, no adjustment needs to be made. However, if the intraday time peri- could have been coincidental, but it does
od fell on an ex-dividend date, an adjustment would have to be made to indicate that four weeks of test data was
avoid distortion. enough to capture the intraday price
dynamics of this stock.
100
99
-1
98
97
96
95
1
94
93
3/26 11:20 12:15 1:10 2:05 3:00 3/27 11:15 12:10 1:05 2:00 2:55 3/28 11:10 12:05 1:00 1:55 2:50
Source: TradeStation by TradeStation Group
being whipsawed by
performance of an intraday
W hen testing any trading strategy, the
important point is how well it will
perform on data on which it has not
been optimized — that is, out-of-sample data.
If a certain system is first tested on a “sample”
piece of historical price data (say, daily bars
breakout strategy. from 1993 up to 1998), the system’s perform-
ance results have no implication outside this
sample data set; all you know is how well your
system parameters performed during this par-
ticular period.
To get an idea of how the system might actu-
ally perform, the system parameters used for
the sample data should be applied to different
“out-of-sample” price data (say, daily bars
from 1998 to the present). This “walk-forward
process” simulates the application of a system
to future data, as would occur in actual trad-
ing. In short, without out-of-sample testing,
such random movement, the NCBS adds a “noise filter,” designat- it’s nothing more than hope to believe that sys-
ed by the symbol f, to the basic channel breakout system. The three tem performance in the future will be any-
system parameters for the NCBS are: where near the optimized performance.
For example, it’s possible to take a trading
• nhi, which is the number of bars in the lookback period strategy with four independent variables, or
used to determine the highest high price (hhp). parameters, and with hindsight, find the values
• nlo, which is the number of bars in the lookback period for each of them that give the best (optimized)
used to determine the lowest low price (llp). results on a specific historical period — say, the
• f, which is the amount price must exceed the hhp or llp last three years (using daily price data).
to trigger a buy or sell. However, these optimized parameter values
have been, in essence, cherry-picked for this
The Noise Channel Breakout System 2 particular data period (a process known as
The Noise Channel Breakout System 2 (NCBS-2) uses different fil- “curve-fitting”), and are unlikely to perform as
ter values (f, from the original system) for the long and short sides well on other historical test periods, or in actu-
of the market. As a result, there are four system parameters for the al trading in the future. An important (but
NCBS-2: unspoken) point in walk-forward testing is that
if you cannot get good results in the out-of-
• nhi, which is the number of bars in the lookback period sample data segments, real-time system per-
used to determine the highest high price (hhp). formance will be random.
• nlo, which is the number of bars in the lookback period
used to determine the lowest low price (llp).
Entry Entry Entry Exit Exit Exit Bars Trade Trade Trade Time Trade Time
date time price date time price in trade $ % Max Max
P&L P&L $Pft $DD
3/26/01 10:20 Sell 93.75 3/26/01 15:55 94.52 67 (770) (0.82) 0 10:20 (1,620) 10:35
3/27/01 10:15 Buy 95.59 3/27/01 15:55 99.59 68 4,000 4.18 4,300 15:50 0 10:15
3/28/01 9:40 Sell 97.92 3/28/01 15:55 94.50 75 3,420 3.49 3,420 12:00 (380) 9:40
3/29/01 10:05 Buy 96.05 3/29/01 15:05 94.90 60 (1,150) (1.20) 950 10:30 (1,160) 11:20
3/29/01 15:05 Sell 94.90 3/29/01 15:55 94.88 10 20 0.02 390 15:15 (500) 15:45
3/30/01 9:40 Buy 96.70 3/30/01 13:05 96.20 41 (500) (0.52) 800 11:55 (1,190) 10:00
3/30/01 13:05 Sell 96.20 3/30/01 15:55 96.25 34 (50) (0.05) 220 13:15 (840) 14:35
4/2/01 10:55 Sell 96.45 4/2/01 15:55 94.50 60 1,950 2.02 2,650 15:40 (1,250) 11:40
4/3/01 9:40 Sell 93.33 4/3/01 15:55 90.50 75 2,830 3.03 3,070 15:40 (670) 9:45
4/4/01 10:55 Buy 92.99 4/4/01 12:55 92.55 24 (440) (0.47) 910 11:20 (660) 11:00
4/4/01 12:55 Sell 92.55 4/4/01 15:55 91.85 36 700 0.76 930 14:00 (520) 13:20
4/5/01 9:40 Buy 95.68 4/5/01 15:55 98.15 75 2,470 2.58 3,040 15:25 (10) 9:40
4/6/01 9:40 Sell 97.30 4/6/01 12:00 98.75 28 (1,450) (1.49) 550 11:15 (1,450) 12:00
4/6/01 12:00 Buy 98.75 4/6/01 12:35 97.02 7 (1,730) (1.75) 1,150 12:05 (1,730) 12:35
4/6/01 12:35 Sell 97.02 4/6/01 15:55 97.67 40 (650) (0.67) 20 12:35 (2,240) 13:55
Total Average Average Average
8,650 0.61% 1,493 (948)
Source: Meyers Analytics
Entry Entry Entry Exit Exit Exit Bars Trade Trade Trade Time Trade Time
date time price date time price in trade $ % Max Max
P&L P&L $Pft $DD
3/26/01 10:20 Sell 93.75 3/26/01 15:55 94.52 67 (770) (0.82) 0 10:20 (1,620) 10:35
3/27/01 10:15 Buy 95.59 3/27/01 15:55 99.59 68 4,000 4.18 4,300 15:50 0 10:15
3/28/01 9:40 Sell 97.92 3/28/01 15:55 94.50 75 3,420 3.49 3,420 12:00 (380) 9:40
3/29/01 10:05 Buy 96.05 3/29/01 15:05 94.90 60 (1,150) (1.20) 950 10:30 (1,160) 11:20
3/29/01 15:05 Sell 94.90 3/29/01 15:55 94.88 10 20 0.02 390 15:15 (500) 15:45
3/30/01 9:40 Buy 96.70 3/30/01 13:05 96.20 41 (500) (0.52) 800 11:55 (1,190) 10:00
3/30/01 13:05 Sell 96.20 3/30/01 15:55 96.25 34 (50) -0.05) 220 13:15 (840) 14:35
4/2/01 9:40 Buy 97.75 4/2/01 10:55 96.40 15 (1,350) -1.38) 350 10:05 (1,350) 10:55
4/2/01 10:55 Sell 96.40 4/2/01 15:55 94.50 60 1,900 1.97 2,600 15:40 (1,300) 11:40
4/3/01 10:00 Sell 93.00 4/3/01 15:55 90.50 71 2,500 2.69 2,740 15:40 0 10:00
4/4/01 9:45 Buy 92.00 4/4/01 13:50 92.00 49 0 0.00 1,900 11:20 (1,890) 10:30
4/4/01 13:50 Sell 92.00 4/4/01 15:55 91.85 25 150 0.16 380 14:00 (500) 14:20
4/5/01 9:40 Buy 95.68 4/5/01 15:55 98.15 75 2,470 2.58 3,040 15:25 (10) 9:40
4/6/01 9:40 Sell 97.30 4/6/01 11:55 98.24 27 (940) (0.97) 550 11:15 (940) 11:55
4/6/01 11:55 Buy 98.24 4/6/01 12:35 97.30 8 (940) (0.96) 1,660 12:05 (940) 12:35
4/6/01 12:35 Sell 97.30 4/6/01 15:55 97.67 40 (370) (0.38) 300 12:35 (1,960) 13:55
Total Average Average Average
8,390 0.55% 1,475 (911)
Source: Meyers Analytics
Trade signals for the NCBS-2 are shown on a five-minute chart of IBM. The blue and red lines are the long and short
filter levels, respectively.
-1 99
98
97
96
95
-1
1
94
0
0
93
4,000
2,500
1,000
500
9:55 10:50 11:45 12:40 1:35 2:30 3/27 10:50 11:45 12:40 1:35 2:30 3/28 10:50 11:45 12:40 1:35 2:30
chance but does indicate that four weeks of test data were determine if the more complicated NCBS-2 offers any advan-
enough to capture the intraday price dynamics of IBM. tage in the trade-by-trade figures. There seems to be little
The performance summaries in Figures 2a and 2b show advantage: Both systems’ totals and averages are nearly the
there is very little difference between the NCBS and NCBS-2. same. The NCBS-2 had one less trade and slightly better num-
The less-complicated NCBS, while having a slightly lower net bers. However, the difference wasn’t enough to claim any
profit and average win/average loss ratio, has a smaller draw- superiority or to justify the added complication of another
down and a smaller largest losing trade. Comparison of optimization parameter.
Figures 2a and 2b favors the simpler NCBS. The NCBS-2 did very well in catching every major intraday
The out-of-sample trade-by-trade summary of Figure 3 trend of IBM. The charts show the system constraint of not car-
shows the system did better on short trades than on long rying positions overnight eliminated many negative opening
trades. This could indicate a negative bias for the system, or surprises. Overall, the system did a good job in minimizing the
perhaps, given the current bear market, this could be normal. losses resulting from the inevitable whipsaws that will occur in
Whatever the reason, this bias warrants further investigation. any trading system and maximizing the profits from the major
There were no big winners or big losers, indicating steady intraday trend moves of IBM.
returns. Average wins were 2.6 times average losses in the out-of- To use NCBS-2 in real time trading, the results from at least
sample section. Average trade run-ups were $1,493, average trade 10 to 20 more tests and out-of-sample periods would have to be
drawdowns were -$948 and the average trade net profit was $576. examined to make sure that the results above were not due to
It’s also instructive to compare Figure 3 with Figure 4 to pure chance.
B
{Strategy: #MultiBarRangeBO}
reakout systems are popular when markets are
Input: n(45),bx(0.45),m(15),sx(0.45),XTime(1515);
volatile. Such systems typically identify support
vars: hhv1(h),llv1(l),hhv2(h),llv2(l),ii(0),xb(c),xs(c);
and resistance levels when price has been moving
in a range or channel, and enter trades when price
hhv1=h; llv1=l;
breaks out of either the up side or down side of a channel.
for ii=1 to n-1 begin
There are two simple ways to define support and resistance
if h[ii]>hhv1 then hhv1=h[ii]; if l[ii]<llv1 then llv1=l[ii];
levels for price channels. In both cases, it is first necessary to
end;
define a lookback period. The first way is to use the highest
value1=hhv1-llv1;
high and the lowest low of the lookback period. The second
way is to determine the range of each bar (high minus low) and
hhv2=h; llv2=l;
add that range (or a percentage of it) to, or subtract it from, the
for ii=1 to m-1 begin
current close.
if h[ii]>hhv2 then hhv2=h[ii]; if l[ii]<llv2 then llv2=l[ii];
In either case, the upper and lower boundaries represent the
end;
price channel. One advantage to the second method is it better
value2=hhv2-llv2;
reflects the volatility of the market — it will expand and con-
tract as the volatility changes.
xb= c + (Value1 * bx);
Breakout strategies require the market to be in a high-volatil-
xs= c - (Value2 * sx);
ity period; a trade will become profitable only if it continues to
move in the direction of the breakout. Volatility and emotion go
if time<XTime then begin
hand in hand. As volatility increases, traders have to cope with
if marketposition<=0 then Buy Next Bar xb stop;
more risk; hence, the more emotional the market becomes. This
if marketposition>=0 then Sell Short Next Bar xs stop;
is often reflected by the fact markets fall faster than they rise.
end;
In the following system, the channel is determined by using
the range of the price bars in the lookback period. A breakout
if XTime<>0 then SetExitOnClose;
above or below the channel’s resistance or support creates buy
or sell signals.
Short
Short 1,005
Buy 1,000
995
990
Buy Short
End 985
End of day
of day exit
exit 980
600
400
200
0
-200
7/30 9:11 9:33 9:55 10:17 10:39 11:01 11:23 11:45 12:07 12:29 12:51 13:13 13:35 13:57 14:19 14:41 8/1
Source: TradeStation
that quickly reverse and stop out the position. With this sys- difficult to sustain more than a handful of consecutive losses,
tem, if there is a gap on the opening bar, the buy and sell ranges we eliminated all cases that had more than five losing trades in
are expanded and no trades are made until the buy and sell a row. Of the remaining test results, we chose the one that had
ranges contract or the price breaks the expanded ranges. the highest total net profit and the lowest drawdown. The opti-
Breaking the expanded ranges takes time and avoids the open- mization procedure produced the following system parame-
ing gap whipsaw. ters:
Testing n = 45;
The system was tested from July 7 through Aug. 1, 2003, using bx = 0.45;
September 2003 E-Mini futures (ESU03) one-minute bars. A m = 15;
wide range of parameter values was tested to find the optimal sx = 0.45;
ones for the system. The parameter ranges tested for the initial
optimization test were: Table 1 (p. 43) shows the performance summary for the four-
week test period (slippage and commissions not included).
n =10 to 50 in steps of 5; Table 2 (opposite page) is a trade-by-trade summary of all the
bx = 0.4 to 1 in steps of 0.05; trades. The average net profit per trade was $89 — well above
m = 10 to 50 in steps of 5; slippage and commissions for a typical S&P E-Mini trade. The
sx = 0.4 to 1 in steps of 0.05; largest losing trade was $300, and the biggest intraday draw-
down was $887. These losses are small compared to the total
After the initial test, we had to choose one set of parameters net profit of $4,912.
that produced the most realistic results. To avoid curve fitting, Figures 2 and 3 are one-minute charts of the S&P E-Mini
we eliminated all results that had profit factors (gross profit that span July 31 to Aug. 1. The Multibar Range Breakout chan-
divided by gross loss) greater than 4.0, since such performance nels are superimposed on the price series, and all the buy and
was unlikely to be duplicated in the future. Also, because it is sell signals are marked. Finally, the bottoms of Figures 2 and 3
600
400
200
14:19 14:41 8/1 9:02 9:24 9:46 10:08 10:30 10:52 11:14 11:36 11:58 12:20 12:42 13:04 13:26 13:48 14:10 14:32 14:54
Source: TradeStation
975
Individual articles can be purchased and
7 14 21 28
downloaded from www.activetradermag.com/
purchase_articles.htm. Source: TradeStation
EQUITY CURVE
600,000
DeMark variation
500,000
Markets: Stocks, stock index futures, index stocks
(SPDRs, DIAs, QQQs), futures and currencies
400,000
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
ST = AC * PR / Dist
where 11.00
ST = Shares to trade
AC = Available capital 10.00
PR = Percent risked
Dist = Distance between the entry
price and the exit price on the day 9.00
of entry.
Test period:
May June July August September October
April 1993 to October 2002.
Source: Omega Research ProSuite
better than a Nasdaq 100 buy-and-hold strategy over the last 30 ROLLING TIME WINDOW RETURN ANALYSIS
months (a 43 percent drawdown compared to the Nasdaq’s 83
percent). Cumulative 12 24 36 48 60
months months months months months
It is quite difficult to succeed over the long term with a sys-
tem that sells short because of the inherent upside bias of the Most recent: 8.69% -19.18% 15.28% 63.22% 26.23%
stock market, and the high volatility associated with bear mar- Average: 8.77% 20.27% 34.69% 46.45% 58.78%
kets. For this system, the high volatility makes it difficult to Best: 104.96% 106.03% 131.24% 148.03% 186.41%
enter potential winning short trades and exit losing trades.
Worst: -27.93% -38.42% -14.94% 5.25% 4.40%
The best way to improve the results for this system would
probably be to reverse the logic for the exit so that it would be St. dev.: 27.06% 30.46% 28.77% 33.48% 40.51%
easier to exit during times of high volatility. This would most
Annualized 12 24 36 48 60
likely result in more and smaller losing trades, but also in larg- months months months months months
er winning trades because the system would exit closer to the
Most recent: 8.69% -10.10% 4.85% 13.03% 4.77%
STRATEGY SUMMARY Average: 8.77% 9.67% 10.44% 10.01% 9.69%
Best: 104.96% 43.54% 32.24% 25.49% 23.42%
Profitability Trade statistics
Worst: -27.93% -21.53% -5.25% 1.29% 0.86%
End. equity ($): 164,849 No. trades: 1,133
St. dev.: 27.06% 14.22% 8.79% 7.49% 7.04%
Total return (%): 65 Avg. trade ($): 57
Avg. annual ret. (%): 5.36 Avg. DIT: 63.3 LEGEND: Cumulative returns — Most recent: most recent return from start to
end of the respective periods • Average: the average of all cumulative returns
Profit factor: 1.15 Avg. win/loss ($): 1,053 (435) from start to end of the respective periods • Best: the best of all cumulative
Avg. tied cap (%): 74 Lrg. win/loss ($): 37,484 (2,209) returns from start to end of the respective periods • Worst: the worst of all cumu-
lative returns from start to end of the respective periods • St. dev.: the standard
Win. months (%): 50 Win. trades (%): 34.1
deviation of all cumulative returns from start to end of the respective periods
Drawdown TIM (%): 100 92.8 Annualized returns — The ending equity as a result of the cumulative returns,
Max. DD (%): 43.1 Tr./Mark./Year: 3.9 raised by 1/n, where n is the respective period in number of years
Longest flat (m): 31.3 Tr./Month: 9.9
Send Active Trader your systems
If you have a trading system or idea you’d like tested, send it to
LEGEND: End. equity ($) — equity at the end of test period • Total return
(%) — total percentage return over test period • Avg. annual ret. (%) — us at the Trading System Lab. We’ll test it on a portfolio of
average continuously compounded annual return • Profit factor — gross stocks or futures (for now, maximum 60 markets, using the last
profit/gross loss • Avg. tied cap (%) — average percent of total available cap- 2,500 trading days), using true portfolio analysis/optimization.
ital tied up in open positions • Win. months (%) — percentage profitable Most system-testing software only allows you to test one mar-
months over test period • Max. DD (%) — maximum drop in equity • ket at a time. Our system-testing technique lets all markets
Longest flat — longest period, in months, spent between two equity highs • share the same account and is based on the interaction within
No. trades — number of trades • Avg. trade ($) — amount won or lost by the portfolio as a whole.
the average trade • Avg. DIT— average days in trade • Avg. win/loss ($) Start by e-mailing system logic (in TradeStation’s
— average winning and losing trade, respectively • Lrg. win/loss ($) — EasyLanguage or in an Excel spreadsheet) and a short description
largest winning and losing trade, respectively • Win. trades (%) — percent to editorial@activetradermag.com, and we’ll get back to you.
winning trades • TIM (%) — amount of time there is at least one open posi- Note: Each system must have a clearly defined stop-loss level
tion for entire portfolio, and each market, respectively • Tr./Mark./Year — and a suggested optimal amount to risk per trade.
trades per market per year • Tr./Month — trades per month for all markets
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
$140,000
breakout system $120,000
$80,000
System logic: This is the same system tested on 30
Nasdaq stocks (p. 60, where you can read more about $60,000
the system’s logic).
$40,000
The system is based on the Donchian breakout sys-
tem, which enters a trade as soon as the market trades $20,000
above or below the highest or lowest price of the last
$0
four weeks (approximately 20 days). 3/26/93 3/26/94 3/26/95 3/26/96 3/26/97 3/26/98 3/26/99 3/26/00 3/26/01 3/26/02
The Donchian breakout system was invented by
Richard Donchian in the 1970s and refined by Richard Dennis in least some of the markets traded should be in strong trends.
the 1980s. The more popular it became, the more other traders These markets should be able to produce profits large enough
modified the system by varying the lookback periods, applying to make up for the whipsaw losses produced in the other mar-
other types of filters and attaching various money management kets plus enough additional profits to make trading worth-
rules. while.
The dynamic breakout system is a modified version of the
Donchian system that alters the lookback period between 20 Rules:
and 60 days depending on the volatility of the market. This sys- 1. Go long on the open if yesterday’s close is higher than
tem and the volatility breakout system used in the January the highest high of the lookback period.
Trading System Lab are likely the most commonly used strate- 2. Exit by reversing the position.
gies of all time, particularly in the commodity futures market.
This is a result of commodity futures markets’ historical ten- Reverse the rules for short trades.
dency to trend. The idea is that capturing a strong trending
move should more than make up for a large number of small Money management:
losing trades produced during times of consolidation and stag- 1. Risk 2 percent of available equity per trade.
nant prices. Applying the system to many different futures mar- 2. The number of contracts to trade was calculated with the
kets should result in a steady profit, as it is highly likely that at following formula:
CT = AC * PR / Dist
SAMPLE TRADES
where
Oats (O), daily
CT = Contracts to trade
210.00 AC = Available capital
Sell 200.00
PR = Percent risked
Dist = Distance between the
190.00 entry price and the exit price on the
180.00 day of entry.
May June July August September October Test results: It is fair to say this sys-
Source: Omega Research ProSuite tem did not work very well from
1996 to 1999. However, since 1999 it
-5%
However, as the performance summary shows,
-10% this system is potentially poised to launch itself into
a new period of prosperity. This shows the market
-15% works in cycles, and just when you’re about to
throw in the towel, things often take a turn for the
-20%
better.
Aside from the various ways of improving this
-25%
strategy suggested on p. 60, the best way to opti-
-30% mize it for the futures markets is to trade it in many
markets. Trading a large number of markets is pos-
-35% sible thanks to the relatively low margin require-
ments of the futures markets (often only 5 to10 per-
has gained ground little by little, slowly increasing its average cent of the total contract value).
annual return. For example, the average return for the last
three years has been 6.4 percent. However, the return for the
past 12 months has been 9.97 percent, and the return is close to
ROLLING TIME WINDOW RETURN ANALYSIS
30 percent for the last six months.
Granted, there still is a long way to go before the system can Cumulative 12 24 36 48 60
months months months months months
find its way out of a drawdown that has lasted for almost
seven years, but the recent upward trend confirms our findings Most recent: 9.97% 17.00% 20.46% 0.25% 2.89%
from last month that the long-term trend-following strategy is Average: 2.53% 4.64% 4.24% 2.94% 2.18%
ready to stage a comeback as a profitable trading system. Best: 44.61% 47.38% 47.95% 50.34% 49.68%
In the late 1990s, many analysts claimed that long-term Worst: -20.11% -19.85% -25.71% -28.62% -24.67%
trend-following systems would no longer make money. The St. dev.: 11.36% 17.85% 21.91% 22.75% 21.23%
reason, they argued, was that the markets had become so
sophisticated over the last several years that whatever ineffi- Annualized 12 24 36 48 60
ciencies made the strategy profitable during the 1970s and months months months months months
1980s had been eliminated. Most recent: 9.97% 8.17% 6.40% 0.06% 0.57%
Average: 2.53% 2.30% 1.40% 0.73% 0.43%
STRATEGY SUMMARY Best: 44.61% 21.40% 13.95% 10.73% 8.40%
Profitability Trade statistics Worst: -20.11% -10.48% -9.43% -8.08% -5.51%
End. equity ($): 123,221 No. trades: 199 St. dev.: 11.36% 8.56% 6.83% 5.26% 3.93%
Total return (%): 23 Avg. trade ($): 117
Avg. annual ret. (%): 2.20 Avg. DIT: 90.1 LEGEND: Cumulative returns — Most recent: most recent return from start to
Profit factor: 1.03 Avg. win/loss ($): 2,028 (1,045) end of the respective periods • Average: the average of all cumulative returns
from start to end of the respective periods • Best: the best of all cumulative returns
Avg. tied cap (%): 40 Lrg. win/loss ($): 21,163 (2,832)
from start to end of the respective periods • Worst: the worst of all cumulative
Win. months (%): 52 Win. trades (%): 32.2 returns from start to end of the respective periods • St. dev.: the standard devia-
Drawdown TIM (%): 100 51.2 tion of all cumulative returns from start to end of the respective periods
Max. DD (%): 32.9 Tr./Mark./Year: 1.4 Annualized returns — The ending equity as a result of the cumulative returns,
raised by 1/n, where n is the respective period in number of years
Longest flat (m): 82.6 Tr./Month: 1.7
Send Active Trader your systems
LEGEND: End. equity ($) — equity at the end of test period • Total return If you have a trading system or idea you’d like tested, send it to
(%) — total percentage return over test period • Avg. annual ret. (%) — us at the Trading System Lab. We’ll test it on a portfolio of
average continuously compounded annual return • Profit factor — gross stocks or futures (for now, maximum 60 markets, using the last
profit/gross loss • Avg. tied cap (%) — average percent of total available cap- 2,500 trading days), using true portfolio analysis/optimization.
ital tied up in open positions • Win. months (%) — percentage profitable Most system-testing software only allows you to test one mar-
months over test period • Max. DD (%) — maximum drop in equity • ket at a time. Our system-testing technique lets all markets
Longest flat — longest period, in months, spent between two equity highs • share the same account and is based on the interaction within
No. trades — number of trades • Avg. trade ($) — amount won or lost by the portfolio as a whole.
the average trade • Avg. DIT— average days in trade • Avg. win/loss ($) Start by e-mailing system logic (in TradeStation’s
— average winning and losing trade, respectively • Lrg. win/loss ($) — EasyLanguage or in an Excel spreadsheet) and a short description
largest winning and losing trade, respectively • Win. trades (%) — percent to editorial@activetradermag.com, and we’ll get back to you.
winning trades • TIM (%) — amount of time there is at least one open posi- Note: Each system must have a clearly defined stop-loss level
tion for entire portfolio, and each market, respectively • Tr./Mark./Year —
and a suggested optimal amount to risk per trade.
trades per market per year • Tr./Month — trades per month for all markets
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
FIGURE 2 EQUITY CURVE (MODIFIED EXIT RULE) FIGURE 3 EQUITY CURVE (SIMPLE EXIT RULE)
The modified exit rule produced modest profits The simple 55-day low exit technique actually
over the test period. outperformed the modified stop.
650,000 1,000,000
600,000 950,000
900,000
550,000 850,000
800,000
500,000
750,000
450,000 700,000
650,000
400,000
600,000
Account balance ($)
550,000
Account balance ($)
350,000
500,000
300,000 450,000
250,000 400,000
350,000
200,000 300,000
150,000 250,000
200,000
100,000 150,000
100,000
50,000
50,000
0 0
3/22/94 5/1/95 6/3/96 7/3/97 8/3/98 9/1/99 11/1/00 1/2/02 2/3/03
3/22/94 5/1/95 6/3/96 7/3/97 8/4/98 9/3/99 11/1/00 1/2/02 2/3/03
Equity Cash Linear Reg. Long Short Equity Cash Linear Reg. Long Short
Drawdown
limit down moves could lead to higher losses. -10.00%
-12.00%
Starting equity: $250,000 (nominal). Deduct -14.00%
$20 slippage/commission per round-turn
-16.00%
trade.
-18.00%
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
resents new, “unseen” price action), the system is considered to Test results — In-sample: All parameter combinations were
have a better chance of working in real trading. The process is profitable. Figure 1 (above) shows the top combinations sorted
referred to as “walk-forward testing” because the system can be by “Recovery Factor,” which is the absolute value of the sys-
progressively applied to new data to see if it continues to perform. tem’s net profit divided by its maximum drawdown (see the
We will explore that concept here. To illustrate the principles stock Trading System Lab on p. 56 for the significance of this
in a straightforward fashion, we test a basic, long-only monthly statistic).
breakout system on a single market, the T-Bond.
Even though the monthly highs and lows define the FIGURE 2 PROFIT CURVE
entry points, we will use end-of-day data to take The optimized monthly breakout system slightly underperformed
opening gaps into consideration. buy-and-hold, but it had a much lower risk level.
Whenever performing out-of-sample testing,
40,000
expect the performance to be worse than the in-sam-
35,000
ple tests. This is not a reflection of the quality of the
30,000
Account balance ($)
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.
Entry rules:
Long trades: Buy if the closing price of the third 30-minute Test period: October 2002 through October 2003.
bar is above the high of the first 60 minutes of the day.
Initial test results: The system’s performance was disappoint-
Short trades: Sell short if the closing price of the third 30- ing — an overall loss of -3.25 percent. With 3,546 trades in the
minute bar is below the low of the first 60 minutes of the day. test period, this is one of the more active systems tested here.
However, even setting the commission at one cent per share
Exit: Exit all positions on signals in the opposite direction or (advisable for a system that generates this many trades) still
at the end of the day. resulted in $13,576 in commission charges. Figure 1 shows
long trades were slightly profitable, generating a 4.22-percent
Money management: Each trade is sized at five percent of the profit during this period.
current account equity. This will allow all trades the
system is generating to be executed. Increasing the
percentage would require dropping trades that FIGURE 2 ADDING A FILTER
exceeded the available cash limit. The bars show the average per-trade profit that would have been
captured by adding the CMO as a trade filter.
Starting equity: $100,000 (nominal). Deduct $0.01 per 0.80%
share slippage and commissions.
0.70%
Disclaimer: The Trading System Lab is intended for educational purposes only to provide a perspective on different market concepts. It is not meant to recommend or
promote any trading system or approach. Traders are advised to do their own research and testing to determine the validity of a trading idea. Past performance does not
guarantee future results; historical testing may not reflect a system’s behavior in real-time trading.