You are on page 1of 5

Click HERE to Learn How I Make $1000 Per Day!

TECHNICAL ANALYSIS

HOW TO TEST AND INTERPRET


TRADING SYSTEM PERFORMANCE
By Wayne A. Thorp

Many forces are at Pick up any technical analysis trade magazine, and inevitably you will run
work when you trade across companies and practitioners marketing technical analysis trading
systems. Like any other type of investment strategy or methodology, a
a system popular way to determine how one system stacks up against another is by
commissions, comparing annual returns. While these numbers are helpful in separating the
slippage, protective winners from the losers, it is important to keep in mind that a multitude of
stops, idle interest, factors impacts the performance of any trading system.
margin, and short When judging the efficacy of a systems reported performance or the
performance of a system you create, keep in mind several issues:
trading can all Are the performance figures based on backtesting or actual trading?
significantly influence Is the system optimized and, if so, how does it perform over hold-out
a trading systems periods?
performance results. How does it handle income reinvestment?
Are there any tax implications?
What are the assumptions inherent to the system itselfcommissions,
slippage, and money and risk management stops?
This article will walk you through a general discussion of how these ele-
ments can impact the financial performance of a trading system.

ACTUAL TRADING RESULTS?

When confronted with the results of a trading system, your first thought
should be: How were these results generated? If a system claims returns of
25% a year, is this based on actual trading or historical backtesting?
Backtesting involves testing a system using a set of historical data. Results
based on actual trading have a greater degree of credibility because returns
are generated over actual trading conditions as they happen. Secondly, results
based on backtesting are more easily manipulated to generate the highest
possible return (the practice is called optimizing).

GAUGING PERFORMANCE

However, backtesting using historical data is the most efficient manner to


derive system performance statistics. Backtesting is the fastest and most
popular way to gauge the potential profitability of a trading system. The
process of backtesting involves running a system over historical data. The end
result is system performance statistics that show how the system would have
performed had it actually been used over that time period. In order to
backtest a system, all you need is the historical database.
Ideally, whenever you backtest a system, you want to use a significant
amount of data in order to capture as many different market phases as
possible. The amount of data you will require depends, in part, on the system
you are testingreal-time, tick-by-tick systems require several days or weeks
of tick data while end-of-day systems will need at least several years of daily
data. The bottom line, however, is that the more data you have, the more
complete the picture you can draw from your backtesting results.

Wayne A. Thorp is assistant financial analyst of AAII.

30 AAII Journal/January 2001


Click HERE to Learn How I Make $1000 Per Day!
TECHNICAL ANALYSIS

A drawback to historical closing price moves below the pay dividends, the dividend income
backtesting is that results are based moving average line. Optimizing received will have a positive impact
upon events that have taken place in would run the system over the data, on performance.
the past. Therefore, the most you testing varying moving average Another issue that few, if any,
can hope to learn from backtesting lengths to find the period that netted trading system packages explicitly
is how a system may perform. There the largest gain or the smallest loss. account for is taxes. Depending on
is no guarantee that what has The problem with optimizing is your holding periodshort-term or
happened in the past will repeat that you are finding the best set of long-termthe marginal tax rate on
itself going forward. The usefulness parameters for a fixed period in the your gains will differ. Those holding
of backtesting lies in its ability to past. However, there is no guarantee an investment for over one year are
provide insight into how a system that the past will repeat itself. While subject to the long-term capital gains
may react in various market condi- optimizing isnt necessarily a bad rate of 20%. If you hold an invest-
tions. Backtesting can often show thing, it is easy to fall into the trap ment for less than a year, gains are
you if a system works better during of over-optimizing. In the end, you viewed as income, which is taxed at
trending markets compared to may have a system that performs your marginal income tax rate.
trading (sideways) markets, or vice spectacularly in the optimization Depending on your income tax
versa. period, but falls apart when tested bracket, therefore, you would need
You should also keep in mind the over any other period. to generate a higher rate of return to
period over which a system is One way to validate or disprove overcome the tax effects as com-
backtested. If backtested results the effectiveness of optimizing is pared to someone holding their
cover odd periods, this should through the use of a hold-out investment(s) for more than one
serve as a red flag for possible perioda set of data over which the year.
manipulation. Companies sometimes system is not optimized. Returning
only report results for the periods in to our earlier example, let us assume SYSTEM ASSUMPTIONS
which the system performed best. If you have 20 years of historical data
the results are for the period 1992 for backtesting. A hold-out tech- When you construct a trading
through 1999, you should ask nique to follow would be to opti- system, the assumptions you make
yourself how the system did during mize the system over one half of the (or fail to make) play a role in how
the market downturns of 1991 and data (10 years) to arrive at the well your system may perform.
2000. Often, the performance of the optimal moving average period These assumptions involve initial
system outside the reporting period length. From there, you would then equity position, trading on margin,
will have an adverse affect on the test the optimized system over the the handling of short trades, com-
overall performance. Ideally, you second half of data. If the results missions, time and price slippage,
would like to have system results from the two 10-year periods are risk and money management stops,
that cover several market cycles comparable, you can be more and interest earned on idle balances.
both good and bad. confident that the system will
A final thought to consider is how perform in a similar manner over Initial Equity
a system performed in comparison other periods and, most importantly, The initial equity amount is the
to a buy and hold strategy. The going forward. If, on the other hand, amount of money you have in your
whole idea behind trading a given the results over the last 10 years account before you begin trading. By
strategy is to garner greater returns differ dramatically from the first 10 beginning with a sizable amount of
than if you simply bought the stock years, you should begin to question equity, you gain greater flexibility in
and held it over the period. If you the viability of the system. the form of entering a larger posi-
cannot outperform such a strategy, tion, which, in turn, can generate
you need to go back to the drawing OTHER FACTORS larger total dollar gains (or losses).
board and try again. Typically, by entering with more
You should be aware of a few money, you can stay in the game
SYSTEM OPTIMIZATION factors that, while todays software longer. This is especially true if you
does not take them into account, can plan to short stocks. Short sellers
Optimizing is the process of affect the overall performance of a hope to profit from stock price
fitting a trading system to a trading system. declines by borrowing stock and
specific set of data. For example, The receipt or reinvestment of selling it first, then buying the stock
suppose you are using a simple dividends is an issue that is not later at a lower price and returning
moving average system that gener- handled by most technical analysis the borrowed shares. When a stock
ates buy signals when the closing programs. However, it can have a is sold short, your potential loss
price moves above the moving significant bearing on a systems extends well beyond your initial
average and sell signals when the performance. If you trade stocks that investment. Depending on who you

AAII Journal/January 2001 31


Click HERE to Learn How I Make $1000 Per Day!
TECHNICAL ANALYSIS

ask, you will probably receive this juncture, you are required to Commissions
different answers regarding the either liquidate part of your existing People tend to forget what a
ideal equity balance. Ultimately, it position or send in more money to dramatic impact commissionsthe
is up to you, just be sure you can bring the value of your account fees paid for buying and selling
afford to lose it! back above the predetermined level; securities through a brokercan
or your broker can sell your securi- have on the overall success of a
Short, Long, or Both? ties without calling. trading system.
One critical issue involves how to Investing on margin carries with it To get a more accurate picture of
deal with sell orders. When a sell is risks and rewardsit magnifies the a systems profitability, it is impor-
triggered, you could sell your long effects of gains and losses. Return- tant to figure in the commission
position and go to cash, or you can ing to our $10,000 margin account costs. This is especially important
elect to be more aggressive and example, let us assume you buy for a system that generates numer-
double down. This involves selling 1,000 shares of stock priced at $20. ous buy and sell signals, which will
your long position and establishing a You pay for this transaction by dramatically lower the profits or
short position in which you profit if borrowing $10,000 from your increase the losses of a system.
the security decreases in value, but broker and using your $10,000 from Commissions can vary greatly
you lose money if the security goes your account. If, in a year, the price depending on the type of security
up in value. rises to $40 a share, the value of you are trading and whether you are
your investment has risen from using a deep-discount broker or a
Margin $20,000 to $40,000. If you sell the full-service one.
Margin investing is a delicate topic shares and pay back the $10,000
that investors should understand you borrowed from your broker Slippage
before attempting. Margin is money (including margin interestinterest Another element that many
you borrow from a broker, similar to charged by the broker for the traders lose sight of is the fact that
a loan, that you then use to buy privilege of using their money), you you will rarely be able to enter or
stocks. You cannot buy all stocks on would have roughly $30,000 exit a trade at exactly the same
margin: Those priced below $5, remaining$20,000 of which is price at which the trading signal
certain other Nasdaq stocks, and profit to you. was generated. If your system is
IPOs within a certain period of their On the other hand, if you simply based on end-of-day data, a buy or
introduction are excluded. use your $10,000 to buy 500 shares sell signal will be generated after the
Brokers are regulated by the of the $20 stock, your profit would market close. Realistically, your first
Federal Reserve as to how much be roughly $10,000. In the first opportunity to act on the signal is at
credit they can extend to their clients. example, you would have made the open the next day. The differ-
Currently, you can initially borrow $20,000 on a $10,000 investment, ence between the price at which the
up to 50% of the value of your while in the second you would have signal was generated and the price
marginable securities for stocks. For made $10,000 on that same at which your order is actually filled
example, assume you have $10,000 $10,000 investment. is called slippage. When testing a
in a margin-approved brokerage Just as margin can improve your trading system, it is important to
account. This means you can pur- profit, it can also worsen your account for slippage; otherwise the
chase up to $20,000 of marginable losses. If the $20 stock you initially trading results are overstated. Some
securities, with 50% coming from bought on margin falls to $15 a software programs allow you to
you and 50% from the brokerage. share, the investment value falls specify slippage in dollar or percent-
Another way to word it is that you from $20,000 to $15,000. After age terms, while others allow you to
have $20,000 of buying power. paying back the $10,000 you build in a time delay between the
The amount you are able to borrowed from the broker, you are signal and order execution.
borrow on margin fluctuates on a left with $5,000 of your original
daily basis as the prices of the $10,000. Without margin, the 500 Stops
marginable securities rise and fall. If shares you bought at $20 would Perhaps the most useful tool in
the prices increase, so too does the now be worth a total of $7,500. developing a trading system is a
amount you can borrow. The With margin, you lose $2,500 more stop. Compared to commissions and
opposite holds true as well: As prices than you would have using only slippage, which are costs associated
fall, the value of the marginable your own money. Be aware, too, with a system, stops are more of a
securitiesyour collateralfalls as that in our examples we did not system tweaking mechanism.
well. If the value of your margined account for commissions, margin Stops are user-defined points where
securities falls below a predetermined interest, or capital gains taxes, a position is closed out. When a
minimum level, you will receive a which, as we have discussed, will stop is triggered, the position is
margin call from your broker. At impact the bottom line. closed regardless of the current

32 AAII Journal/January 2001


TECHNICAL ANALYSIS

status of your trading rules. Stops positions when a specified amount of average (EMA). The exponential, or
allow you to limit your losses should the current open positions profits is exponentially weighted, moving
a trade go against you. The stops lost. Each time a positions profits average is calculated by taking a
you specify in a trading system are reach a new high, the trailing stop is percentage of todays closing price
similar to stop-loss orders you can moved to a level that allows a and applying it to yesterdays
place when executing a trade. As the specified portion of the positions moving average, with greater
name suggests, a stop-loss order is profits to be lost. emphasis placed on the newest price.
designed to stop a loss. If you You are also able to specify the (To learn about exponential moving
purchase a stock for $30, you can number of periods to ignore in averages, refer to the August 1999
protect yourself against the possibil- trailing stops. For example, if you AAII Journal article, An Intro to
ity of it falling in price by placing a instruct the system to ignore three Moving Averages: Popular Technical
stop-loss sell at $30. A market order periods, the trailing stop will lag by Indicators on our web site.)
to sell the stock is placed if the stock three periods. Therefore, the last With our system, buy signals are
falls below $30. three periods profits or losses will generated (and short positions
There are several strategies using be ignored when determining the covered) when the closing price
stops when creating a trading current stop level. Such lags are moves above the 50-day exponential
system, the most popular being useful in filtering out price swings. moving average. Likewise, long
breakeven, inactivity, maximum loss, However, you need to exercise positions are closed and short
profit target, and trailing stops. caution when using trailing stops. positions are entered when the
Breakeven stops close open They are not designed to limit losses, closing price falls below the 50-day
positions when the closed-out value but to lock in profits. exponential moving average. This
of the position equals the amount at system may seem overly simplistic,
which the current trade was opened. Idle Interest but it illustrates the elements we
The stop is placed at the price where Depending on the type of system have been discussing when evaluat-
the trade could be closed and the you are using, there may be times ing, testing, and optimizing a trading
proceeds generated would equal the when you are not in a trade. This system.
equity value when the trade was means that all long trades have been To show how the factors such as
opened. closed and short trades covered. commission, slippage, and stops can
Inactivity stops will close an open Ideally, you will be earning some impact the overall performance of a
position when the securitys price interest on this idle balance. The trading system, we must have a
does not generate a minimum interest you might earn is influenced benchmark against which to com-
percent or price change within a by several factors, including the pare their impacts. Therefore, we
specified time period. If you specify brokerage firm you use to execute begin by presenting a system that, in
1% as the minimum change and 20 your trades, the cash accounts effect, ignores many of these issues.
as the number of periods, the system available, and the size of your Using Walt Disney, we ran our
would automatically close any long account. initial test over the 20-year period
(short) positions where the securitys from November 3, 1980, to October
price has not increased (decreased) HOW IT WORKS: AN EXAMPLE 31, 2000. The only assumptions we
by at least 1% within any 20-period made for this test are that we handle
time frame. Now that you know what to both long and short trades and that
Maximum loss (max loss) stops are consider when testing a trading we begin with a non-margin account
useful as a risk management strat- system and examining the results in balance of $10,000. We do not
egy, because you can specify the general terms, lets take a look at an account for commissions, slippage,
exact percentage or dollar amount of example of how these factors can stops, or interest on idle balances.
your total equity you wish to risk on impact the performance of an actual Running this sterile system
a given position. These stops close system using historical data. For this resulted in a net profit of
an open position when the losses article, we used MetaStock 7.0 by $20,603.32 over the period. While
resulting from the trade exceed the Equis International. the system made money, it fell well
specified maximum loss amount. Before you can begin testing a short of the return netted by a buy-
Profit target stops exit a trade system, you obviously need to have and-hold strategy. If you had bought
once it reaches a predetermined a system to test. A trading system $10,000 of Disney stock at the
profit level. Therefore, if you specify can be as simple or as complex as beginning of the period and sold it
10% as the profit target, open you can imaginefrom a moving at the end, you would have earned
positions will be closed when they average crossover system to one $384,480.56! At this point, it is
generate a 10% profit (after com- consisting of several highly evolved evident that this system needs some
missions). indicators. For our example here, we improving before it is ready to be
Lastly, trailing stops close open use a 50-day exponential moving traded in the real world.

AAII Journal/January 2001 33


TECHNICAL ANALYSIS

Next, we apply our assumptions to Lastly, we entered in our protec- discussion of trading systems is the
the system, individually first and tive stops for the system. The two fact that, although they are mechani-
then in combination. We begin by we used were a trailing stop and cal in their generation of buy and
testing our system assuming that we max-loss stop. Our maximum-loss sell signals, most programs are not
borrowed 20% of our equity on stop closes a trade if it loses 2% of capable of executing their orders for
margin. Although federal regulations our remaining equity. Therefore, in you. Therefore, the performance of
allow you to borrow up to 50%, we essence, we are risking 2% of our your system is ultimately contingent
recommend this only for experienced equity per trade. Remember, how- on whether you execute each and
traders who are well-versed in the ever, that because of slippage, we every trade when you are supposed
implications of trading on margin. run the risk of losing more than 2% to. The most difficult thing for many
Trading on margin had a slightly on a given trade. Our trailing stop traders is not creating, testing, or
negative effect on this systemwe risks 20% of our profit while optimizing a system, it is actually
netted $20,461.44, or $141.88 less ignoring one period to filter out following it in real-time.
than what we would have earned random price swings. Implementing Depending on the type of system
had we not traded on margin. our stops into the system has a you are trading, you may have to
However, if we had followed a buy significant positive impactit netted devote a significant amount of time
and hold strategy using margin, we $102,050.32, $81,447 more than the to monitoring it and executing
would have earned an extra $97,000. sterile system. trades. Intraday systems, those based
Then we tested the system assum- Having discussed all of our factors on real-time or intraday delayed
ing that we pay a $15 commission in isolation and showed how they data, may require your undivided
for each trade generated by the impact the performance of our attention through the course of a
system$15 for each buy and $15 system, it is time to see how they trading day. End-of-day systems,
for each sell. The 807 buy and sell work in tandem with one another. while not demanding the same
trades the system generated over the Our last test combines all of the attention, require daily examination.
20-year period cost us $12,105 in assumptions we have covered, and Therefore, time is another intangible
commissions. However the true cost the end result stands in stark con- cost associated with following a
was $14,101.46 since the money trast to the result we first arrived at. systematic trading strategy.
spent on commissions can not be In this case, our system exhausted all
spent on trades which may cost us of the equity in our account, leaving CONCLUSION
on profitable trades or save us on us with a lossan ending amount of
losing trades. Obviously, depending $9,999.46. Overall, the system It is clear from our discussion here
on the price you pay for transactions generated 502 trades, which cost us that many forces are at work when
and the number of trades you place, $7,530 in commissions. Further- you trade a system. Commissions,
the amount you pay in commissions more, our idle balance earned slippage, protective stops, idle
can vary significantly. $268.96 over the 3,630 days the interest, margin, and short trading
Accounting for slippage, we system was out of all trades, due in all in their unique way influence a
instructed the system to execute large part to a lack of liquidity to trading systems results.
trades at the opening price the day execute trades. Obviously, this Comparing the results of our
after the signal was generated. This system needs some work before it is initial test where we ignored many
adds a greater degree of realism to ready for actual trading! of these factors to the results gener-
the system since signals are not ated when we integrated them shows
generated until after the close of USER ACTION REQUIRED how important it is take them all
trading for the day. This delay in into consideration when evaluating
execution had a tremendous impact What sometimes gets lost in the or testing a trading system.
on the overall performance of the
systema net loss of $1,604.27, or
$22,207.59 less than the sterile Check the following areas of our Web site for more information:
system. Use the Search tool to locate related AAII Journal articles:
In a system such as this, which is An Intro to Moving Averages: Popular Technical Indicators
fully invested, idle interest is not Using Moving Averages in a Systematic Trading Strategy
much of a consideration. In fact, the Computerized Investing subscribers can access these articles:
July/August 2000 Feature: Building & Testing a Trading System
only interest we earned on our idle
May/June 2000 Comparison: Technical Analysis Software
balance was during the first 50 days
Nov/Dec 2000 Comparison: Web-Based Technical Analysis Services
of the system. Since there was no 50- Go to AAIIs list of Top Web Sites under Investor Resources. Scroll down to the best sites for
day exponential moving average charting/technical analysis to connect to sites that offer trading systems and strategies.
during this period, we were not in Download trading shareware from the Stocks/Technical Analysis area of the Download Library.
any trades and we earned $60.

34 AAII Journal/January 2001

You might also like