Chapter 16
IN THIS CHAPTER
Distinguishing different trading systems
Identifying the tools and data required for system development and testing
Maintaining a trading journal
Assessing trading systems that you can buy
A trading system is a collection of technical and fundamental analyses tools woven together to generate buy and sell signals. Trading systems often are built using common indicators, oscillators, and moving averages (see Chapter 11). You can combine these various technical analysis tools to create a virtually unlimited number of trading systems. For the novice trader, the advantage to this approach is that you don’t need to invent something new to create and personalize an effective system.
The downside, however, is equally obvious. Many traders use these common tools and end up with a system that offers little competitive advantage and only modest (if any) profits. In addition, these systems can be difficult to use because the signals of one trading system mirror the signals of many others, which makes entering and exiting positions troublesome.
Ultimately, you want to develop or adapt a trading system that closely fits your personality, trading time frame, schedule, and trading objectives. This chapter helps you methodically develop and add to a trading approach that uses your own personalized repertoire of trading systems. It also helps you recognize and avoid destructive and costly habits that can sabotage your trading efforts. In addition, we discuss ways for you to evaluate some of the claims made about trading systems that are for sale and whether buying someone else’s trading system makes sense.
Although individual trading systems differ in many ways, you can think about them on the basis of a couple of broad characteristics to get a good overview. The first characteristic has to do with the two ways a trader interacts with the system. In this case, trading systems are either
The other way to categorize a trading system is by how it treats trends in the markets. In this case, trading systems are either
Although these categorizations are not mutually exclusive of each other (mechanical and discretionary systems, for example, can both be trend‐following systems), each approach has its fair share of both champions and detractors, so we discuss the strengths and weaknesses of each type of system in the sections that follow.
A discretionary trading system makes you an active participant in all phases of the trades you make and provides you with a great deal of leeway when making trading decisions. With this approach, evaluating the economic data, analyzing the broad‐market indexes, determining which sectors are showing strength, and identifying high‐relative‐strength stocks that are breaking out of long trading ranges and hoping to catch a new trend all are up to you. You make decisions based on what you see in the charts and in the fundamental economic data, and you enter and exit (buy and sell) positions based on that information. When you’re relying on a discretionary trading system, your judgment is a key factor.
When emotions cloud your trading decisions, you may end up
A mechanical system addresses some of the problems that arise when using discretionary systems. Mechanical systems usually are computer‐based programs that automatically generate buy and sell signals based on technical and/or fundamental data. You’re expected to blindly follow the resulting trading signals. Put another way, mechanical trading systems take your judgment out of the equation. In fact, some mechanical systems even enter buy and sell orders directly with your broker without your intervention.
Another benefit of the mechanical approach is having the ability to thoroughly test the system. Through testing you can confirm whether your trading system performs the way you expect it to and explore ways to improve your system before actually committing your trading capital. You can adjust and fine‐tune your system after seeing the test results. Unfortunately, fine‐tuning your system may lead to other problems. We discuss ways to avoid them in the later section “Identifying system‐optimization pitfalls.”
Trend following is favored by many technicians for one simple reason: Trends offer excellent opportunities for profit. Unfortunately, the popularity of the trend‐following approach is one of its greatest weaknesses. Too many of these systems generate very similar buy and sell signals, which, in turn, makes outperforming the average trader difficult for any individual trend‐following trader.
Even the best trend‐following systems have a relatively large percentage of failed trades, primarily because they depend on several extremely profitable trades to make up for the large percentage of losing trades. If your trend‐following system is also a discretionary system, your discretion (or lack of it) can cause you to miss a few of these profitable trades. In this case, your overall results will suffer.
For many traders, the quest to find a profitable countertrend trading system is all consuming. Countertrend systems appear desirable because their goal is to buy low and sell high. These systems try to identify inflection points, or the moments when stocks change direction, so traders can take positions close to when they occur. This approach may work in a few narrowly defined situations, such as in a trading range (Chapter 9) or a trend channel (Chapter 10), but it’s likely to fail in a spectacular and expensive way if attempted on a broader scale.
The vast majority of trading systems follow market trends. This is simply a higher‐probability practice. Trend‐following systems tend to outperform countertrend systems, especially for position traders. Swing traders and some day traders sometimes use a countertrend approach, but even then, they usually do so in conjunction with a trend‐following component. (Flip to Chapters 17 and 18 for more about swing trading and day trading.)
Countertrend systems usually depend on oscillating indicators, reversal patterns, and channeling strategies to find turning points. Some countertrend systems also are based on cycle theory, and others are based on volatility, expansion, and contraction.
As a trader, it’s natural to want some way of confirming that your newly designed system can perform profitably before you commit real trading capital. That means you need a way to test your system, which, in turn, means using computer software to precisely define the system and evaluate its performance. Typically, this requires simulating trades by using historical data.
Doing the math that’s required when testing your system can really slow down your computer, and it can generate a lot of data. Almost any computer will do the job when you’re getting started, but if you end up testing many system ideas, you definitely need a large amount of disk storage and a fast computer. The computer equipment required to run a proprietary trading platform, including products such as TradeStation, is usually enough for system development and testing. (See Chapter 4 for more information about the hardware requirements for a typical proprietary trading platform.)
You’ll come across a wide array of trading system–development and testing products on the market. Some proprietary trading platforms, such as TradeStation, include system‐testing capabilities. Spreadsheet software, like Microsoft Excel, also is useful for analyzing simple trading systems and the results generated by specialized development and testing software.
You need to consider several of the following criteria when evaluating your trading system–development and testing software:
A spreadsheet program is another invaluable testing and analysis tool. Although a spreadsheet program can’t do everything that a specialized system‐development and testing program can do, it can add quite a bit of analysis horsepower to your system‐development tool kit. You can actually code and test simple trading systems directly into the spreadsheet. You can also evaluate the results of your system tests more thoroughly using the spreadsheet’s built‐in statistical and analysis functions.
You can, for example, copy the price data for a stock into your spreadsheet, calculate moving averages and other indicators, and then configure buy, sell, or sell‐short signals. You can also export trading signals from your system‐development program and import the results into your spreadsheet for further analysis.
For example, although your entry signals may show promise, your exit signals may be causing you to leave a lot of money on the table. These situations are hard to see when you’re working only with charts; however, they sometimes jump out when you’re working with raw data during your spreadsheet analysis. You can find an example using this testing technique in the later section “Using breakout trading systems.”
When you need to test your system, you can, of course, test it in real time, with real money, out in the real markets. But getting some idea of how your system will perform before risking your hard‐earned capital is usually a smarter choice. Typically, that means testing your system by evaluating how it performs when simulating trading using historical price data. Ten to twenty years of historical end‐of‐day data for the indexes and stocks you plan to trade is usually more than enough to properly simulate trades for testing your system.
Many sources can provide the data you need to do this. You can download historical data from the Internet, and some online data is available free of charge. Some proprietary trading platforms likewise include access to historical data. You may want to get data from more than one source to confirm its accuracy.
Many online services offer data in a more convenient format but for a price. Some sell historical data recorded on CDs. Sources for intraday price data also are available. Here are the URLs for a few of the many sites offering various forms of historical data:
http://finance.yahoo.com
www.google.com/finance
https://stockcharts.com/h-hd
www.esignal.com
www.iqfeed.net
www.quotetracker.com
www.csidata.com
The ideas that you may want to include in your system development and testing are virtually limitless. Many new traders begin system testing by combining a few off‐the‐shelf indicators in an effort to obtain better trading results. Doing so is as good a place as any to begin.
However, we want to caution you to keep your systems simple enough that you can understand not only the system but also the result. Simplicity usually is better when trading, especially when you’re first becoming familiar with the processes of system development and testing. We describe the process by looking at a couple of examples in the sections that follow.
Many trend‐following systems use a moving average for their starting points. In this trend‐following example, the system is designed for position trading, which means we use a relatively long moving average. Short selling isn’t permitted with this simple system.
The first step is to define buy and sell rules for your initial testing. The actual code for defining these rules depends on your specific system‐development package. Therefore, trading rules are described as generally as possible. The rules for an initial test may look like this:
To test whether using a moving average as a starting point is a good idea in a trend‐following system, apply these two rules to ten years of historical data for the stocks of your choice. After testing this idea, you find that this simple system works fairly well when stock prices are trending, but it’s likely to trigger many losing trades when the prices of stocks are range bound. You can try to avoid these losing trades, and possibly improve your overall trading results, by filtering out trading‐range situations. One way to accomplish that goal is by changing the buy rule to read as follows: Buy at tomorrow’s open when the following conditions are true:
These added conditions serve as signal confirmation. When you test these rules, you find they reduce the number of whipsaw trades for most stocks, but they’re also likely to delay buy and sell signals on profitable trades and thus usually result in smaller profits on those trades. However, this adjustment makes the overall system more profitable because the number of losses is reduced.
You can find out whether other changes that you can make in your simple system can actually improve profitability. You may, for example, test different types of moving averages. Try, for example, a simple moving average (SMA) instead of an exponential moving average (EMA). Or you may want to try using different time frames for your moving average, such as 9‐day, 25‐day, or 100‐day moving averages. See Chapter 11 for more details about the multiple types of moving averages.
Most system‐development and testing software comes equipped with a provision for system optimization, which allows you to fine‐tune the technical analysis tools used in your trading system. You can, for example, tell the system to find the time frame of the moving average that produces the highest profit for one stock and then ask it to do the same thing for a different stock. Some systems enable you to test this factor simultaneously for many stocks.
This is a simple example of a problem that’s well known to scientists and economists who build mathematic models to forecast future events. It’s called curve fitting because you’re molding your model to fit the historical data. You can expend quite a bit of effort fine‐tuning a system to identify all the major trends and turning points in historical data for a particular stock, but that effort isn’t likely to result in future trading profits. In that case, your optimized system is more likely to cause a long string of losses rather than profits.
Another approach is choosing your historical data with extreme care. You can expect trend‐following systems like a moving‐average system to perform well during long, powerful trends. If your stock had a strong run up during the long‐lasting 1990s bull market, that kind of price data can skew your results, magically making any trend‐following system appear profitable. Whether that success actually can be duplicated during a subsequent bull market, however, must first be thoroughly tested.
Similar to moving average–based systems, a breakout system can take many forms. You may already be familiar with the trading‐range breakout system we describe in Chapter 9. To test a different approach, you can define a breakout system as follows:
These trading rules are loosely based on the rules for Donchian channels (sometimes called price channels), which comprise a breakout system developed by Richard Donchian in the 1950s. Donchian was one of the early developers of trend‐following trading systems.
A spreadsheet may be helpful for evaluating this system. You can, in fact, configure this system into a spreadsheet, include buy and sell signals, and perform analyses to determine how well the system performs. You also can use the spreadsheet to dig into the system’s results to find out what works and what doesn’t. Figure 16‐1 shows an example.
Re‐creating the spreadsheet in Figure 16‐1 is straightforward. After downloading the historical price data into a spreadsheet format, all you have to do is encode the formulas into the correct columns. The formulas are described in the nearby sidebar “Creating the Donchian channel spreadsheet.”
If you’re like most traders, the first thing you’ll do is calculate some statistics about the system. For example, you can use spreadsheet functions to calculate the following:
You can then look at aggregate results to find out whether the system actually made money. In the case of the Donchian channel breakout system, initial results don’t look promising. The system lost money during the entire test period.
If you’re like most traders, your impulse is to discard the idea and move on to another. But with the Donchian channel breakout system, you need to dig a little further before you do. During the time frame of this test, the system triggered 30 trades, 18 of which were losing trades. However, 13 of those losing trades were profitable at some point during the process, and all the winning trades gave back a large part of the profits before the sell signal was triggered. In fact, many of the profitable trades gave back significantly more than half of the profits before the sell signal.
Figure 16‐1 shows how a single position from the spreadsheet progressed. The entry trade was triggered when the price of QQQQ closed above the September 4 Donchian high. In this simulated trade, the stock was purchased at the September 5 opening price of $49.56 and then sold on November 9, the day after the price of QQQQ closed below the November 8 Donchian low.
If you look through the last three columns, you’ll notice that this simulated trade was profitable but closed well below its most profitable price. If that happens once during simulated trading, you may not need to worry much about it, but if it occurs frequently, you need to think of ways to remedy the problem.
In any case, this example gives you ideas about how you can use a spreadsheet to test and analyze any trading system. It also provides you with some suggestions about how you can use this kind of analysis to improve your system’s results.
Slippage is the term traders use to describe the costs of trading, which is made up of two components. The first is the actual transaction or commission cost for executing your trade. The second is more difficult to measure because it’s the sum of the costs of unfavorable fills. If, for example, you’re planning to buy at tomorrow’s opening price based on today’s closing price, those two prices can be much different. An unfavorable fill is a cost of trading and accounted for as slippage.
One of the most impactful, high‐leveraged activities you can adopt is to keep track of all your trading activities in a trading journal. Doing so tracks your experiences in the market, helps you process and carefully analyze them while also keeping them in a permanent place, and then allows you to return to those journal entries at a later time to learn from your past experiences. When kept right, your trading journal becomes an invaluable reference manual that can help you recall both what you’ve done right and what you’ve done wrong in the past, thus keeping you on the right track moving forward and preventing the same mistakes again in the future. A trading journal can help you analyze your trades and trading systems to determine which aspects of trading you do well and which ones you need to work on.
When you develop a trading system, save ideas and test results in your journal. When you enter a position, record everything about the trade. Include your thoughts as you contemplate making the trade. When you have a what‐was‐I‐thinking moment later on, you can find the answer in your journal.
You can also use your journal to keep track of more than just your trading history. Save Internet articles or blogs that influenced your thinking. Cut out and archive the new high and new low lists from the newspaper. Keep a record showing leading and lagging industries. Save sector charts along with your trade records. Whatever information you use to make trading decisions needs to be in your trading journal.
You’ll see advertisements on the Internet, in trade magazines, and in newspapers for foolproof systems that promise amazing returns. Sometimes you’ll even see claims for systems that regularly return hundreds of percent with little or no risk.
Although some stocks do actually achieve astronomical returns of hundreds and sometimes thousands of percent, those cases are rare. Consider this: A system that offers profits of 100 percent per year supposedly grows $10,000 into $10 million dollars in only ten years. Be skeptical. Experienced traders know that no system consistently returns 100 percent per year.
Consider this: If you created such a system, would you sell it?
When evaluating these systems, the devil is in the details. Advertisements often are unclear about how a system actually works in real‐world trading, and some vendors make claims based on nothing more than the results of system testing based only on simulated trades and historical data. In fact, the system’s author may never have traded the system using real capital.
Constructing a system that shows great profits when simulating trades with historical data is easy. If you designed a trend‐following system and tested it against data during the period 1997–2000, or 2003–2007, you can be fairly certain that the system is going to perform well in simulated testing. But that doesn’t mean you should use it to trade real money.