Appendix C: The Essentials of Building a Trading System*

Trading system development is part art, part science, and part common sense. Our goal is not to develop a system that achieves the highest returns using historical data, but to formulate a sound concept that has performed reasonably well in the past and can be expected to continue to perform reasonably well in the future.

Ideally, we would prefer an approach that is 100% mechanical, increasing the odds that past performance can be replicated in the future. Mechanical means objective: if 10 people follow the same rules and achieve the same results, those rules are said to be objective. It does not matter whether a mechanical system is written on paper or entered into a computer.

Here, however, we’ll assume that we are using a computer and will use the terms “mechanical” and “computerized” interchangeably. This does not imply that a computer is mandatory for trading system development, although it certainly helps.

The mechanical approach offers us three main benefits:

5 STEP PLAN

  1. Start with a concept
  2. Turn it into a set of objective rules
  3. Visually check it out on the charts
  4. Formally test it with a computer
  5. Evaluate the results

STEP 1: START WITH A CONCEPT (AN IDEA)

Develop your own concepts of how markets work. You can begin by looking at as many charts as you can, trying to identify moving average crossovers, oscillator configurations, price patterns or other pieces of objective evidence which precede major market moves. Also attempt to recognize clues that provide advance warning on moves that are likely to fail. I studied chart after chart after chart in the hope of finding such answers. This “visual” approach has worked for me, and I highly recommend it.

In addition to studying price charts and reading books such as this one, I suggest you read about trading systems and study what others have done. Although no one is going to reveal the “Holy Grail” to you, there is a great deal of useful information out there. Most importantly, think for yourself. I have found that the most profitable ideas are rarely original, but frequently our own.

Most of the successful trading systems are trend following. Counter trend systems should not be overlooked, however, because they bring a degree of negative correlation to the table. This means that when one system is making money, the other is losing money, resulting in a smoother equity curve for the two systems combined, than for either one alone.

Principles of Good Concept Design

Good concepts usually make good sense. If a concept seems to work, but makes little sense, you may be sliding into the realm of coincidence, and the odds of this concept continuing to work in the future diminishes considerably. Your concepts must fit your personality in order to give you the discipline to follow them even when they are losing money (i.e. during periods of drawdown). Your concepts should be straightforward and objective, and if trend following, should trade with the major trend, let profits run and cut losses short. Most importantly, your concepts must make money in the long run (i.e. they must have a positive expectation).

Designing entries is hard, but designing exits is harder and more important. Entry logic is fairly straightforward, but exits have to take various contingencies into account, such as how fast to cut losses or what to do with accumulated profits. I prefer systems that do not reverse automatically—I like to exit a trade first, before putting on another trade in the opposite direction. Work hard to improve your exits, and your returns will improve relative to your risk.

Another suggestion—try to optimize as little as possible. Optimization using historical data often leads one to expect unrealistic returns that cannot be replicated in real trading. Try to use few parameters and apply the same technique across a number of different markets. This will improve your chances of long run success, by reducing the pitfalls of over optimization.

The three main categories of trading systems are:

–   Support/Resistance. Buy a decline into support; sell a rally into resistance.

–   Retracements. Here we buy pullbacks in a bull market and sell rallies in a bear market. For example, buy a 50% pullback of the last advance, but only if the major trend remains up. The danger of such systems is that you never know how far a retracement will go and it becomes difficult to implement an acceptable exit technique.

–   Oscillators. The idea is to buy when the oscillator is oversold and to sell when it is overbought. If divergence between the price series and the oscillator is also present, a much stronger signal is given. However, it is usually best to wait for some sign of a price reversal before buying or selling.

STEP 2: TURN YOUR IDEA INTO A SET OF OBJECTIVE RULES

This is the most difficult step in our 5 step plan, much more difficult than many of us would at first expect! To complete this step successfully, we must express our idea in such objective terms that 100 people following our rules will all arrive at exactly the same conclusions.

Determine what our system is supposed to do and how it will do it. It is with this step that we produce the details needed to accomplish the programming task. We need to take the overall problem and break it down into more and more detail until we finalize all the details.

STEP 3: VISUALLY CHECK IT OUT ON THE CHARTS

Following the explicit rules we just determined in Step 2, let us visually check the trading signals that are produced on a price chart. This is an informal process, meant to achieve two results: first, we want to see whether our idea has been stated properly; and second, before writing complicated computer code, we want some proof that the idea is a potentially profitable one.

STEP 4: FORMALLY TEST IT WITH A COMPUTER

Now its time to convert our logic into computer code. For my own work, I use a program called TradeStation®, Omega Research, Inc. in Miami, FL. TradeStation is the most comprehensive technical analysis software package available for formulating and testing trading systems. It brings together everything from the visualization of your idea, to assistance in trading your system in real time.

Writing code in any computer language is no easy task and TradeStation’s EasyLanguage™ is no exception. The job with EasyLanguage, however, is greatly simplified because of the program’s user friendly editor and the inclusion of many built in functions and plenty of sample code. See Figure C.1.

Once our program has been written, we then move into the testing phase. To begin with, we must choose one or more data series to test. For stock traders this is an easy task. Futures traders, however, are faced with contracts that expire after a relatively short period of time. I like to do my initial testing using a continuous (spread adjusted) price series popularized by Jack Schwager. (Schwager on Futures: Technical Analysis, Wiley, 1996.) If those results look promising, I then move on to actual contracts.

Next, we must decide how much data to use when building our system. I use the entire data series, without saving any for out-of-sample testing (building your system on part of the data and then testing it on the remaining “unseen” data). Many experts would disagree with this approach, but I believe it to be the best with my methodology that relies on good solid concepts, virtually no optimization, and a testing procedure that covers a wide range of parameter sets and markets. I start with a methodology that I believe to be sound and then test it to either prove or disprove my theory. I have found that most individuals do the reverse, they test a data series to arrive at a trading system.

I do not account for transaction costs (slippage and commissions) when testing systems, but instead factor them in at the end. I believe that this keeps the evaluation process more pure and allows my results to remain useful should certain assumptions change in the future.

I require my systems to work across:

Once our testing is complete, let us visually inspect the computer generated trading signals on a price chart to ensure that the system does what we intended it to do. TradeStation facilitates this process by placing buy and sell arrows directly on the chart for us! If the system does not do what it is supposed to do, we need to make the necessary corrections to the code and test it again. Keep in mind that very few ideas will test out profitably, usually less than 5%. And, for one reason or another, most of these “successful” ideas will not even be tradable.

STEP 5: EVALUATE RESULTS

Let us try to understand the concept behind our trading system. Does it make sense or is it just a coincidence? Analyze the equity curve. Can we live through the drawdowns? Evaluate the system on a trade-by-trade basis. What happens if a signal is a bad one? How quickly does the system exit from losers? How long does it stay with the winners? Make sure we are completely comfortable with the test results, otherwise we will not be able to trade this system in real time.

Three key TradeStation statistics to analyze are:

MONEY MANAGEMENT

Money management, while outside the scope of this appendix, is an extremely important topic. It is the key to profitable trading, every bit as important as a good trading system.

Money management techniques should be well thought out. Accept the fact that losses are part of the game. Control your downside and profits will take care of themselves.

In this area, practice diversification as much as possible. Diversification will enable you to increase your returns while holding your risk constant, or decrease your risk while holding your returns constant. Diversify among markets, systems, parameters, and time frames.

CONCLUSION

We have discussed the basic philosophy of trading systems and why objective is better than subjective. We covered the three main benefits of a computerized approach and designed a 5 step plan for building a trading system. And last, but not least, we touched upon the importance of money management and diversification.

Trading systems can improve your performance and help to make you a successful trader. The reasons for that are clear:

With lots of hard work and dedication, anyone can build a successful trading system. It is not easy, but it certainly is within reach. As with most things in life, what you get out of this effort will be directly related to what you put into it. (See Figures C.2 and C.3.)

Figure C.2 (Price Chart): This trading system was designed to be applied to a weekly chart of the Value Line Composite Index (VLCI), but also tested well on a daily chart of the VLCI and on both weekly and daily charts in other markets, votes of confidence in the underlying concept. This is the system described in Figure C.1.

Figure C.3 (Performance Summary): Here is a 36 year Performance Summary of the system shown in Figures C.1 and C.2. Performance over the last 12 years has been consistent with the overall results. The Profit factor, Avg trade (win and loss) and Max intraday drawdown are all excellent

 

*This appendix was prepared by Fred G. Schutzman.