The Essentials of Building a Trading

posted under by ceecabolos

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% mechan­ical, 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 writ­ten on paper or entered into a computer.
*This appendix was prepared by Fred G. Schutzman.
Here, however, we'll assume that we are using a comput­er and will use the terms "mechanical" and "computerized" interchangeably. This does not imply that a computer is mandatory for trading system development, although it cer­tainly helps.
The mechanical approach offers us three main benefits:
· We can back test ideas before trading them. A computer allows us to test ideas on historical data rather than on hard earned cash. By helping us see how a system would have per­formed in the past, it allows us to make better decisions when it really counts—in the present.
· We can be more objective and less emotional. Most peo­ple have trouble applying their objective analysis to actual trading situations. Analysis (where we have no money at risk) is easy, trading (where we have money at risk) is stress­ful. Therefore, why not let the computer pull the trigger for us? It is free of human emotion and will do exactly what we had instructed it to do at the time when we developed our system.
· We can do more work, increasing our opportunities. A mechanical approach takes less time to apply than a sub­jective one, which allows us to cover more markets, trade more systems, and analyze more time frames each day. This is especially true for those of us who use a computer, since it can work faster and longer than we can, without losing its concentration.
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 mov­ing 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 informa­tion 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 sys­tems 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 unre­alistic 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 suc­cess, by reducing the pitfalls of over optimization.
The three main categories of trading systems are:
· Trend following. These systems trade in the direction of the major trend, buying after the bottom and selling after the top. Moving averages and Donchian's weekly rule are popular methodologies among money managers.
· Counter trend
- 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 pre­sent, a much stronger signal is given. However, it is usu­ally best to wait for some sign of a price reversal before buying or selling.
• Pattern recognition (visual and statistical). Examples include the highly reliable head and shoulders formation (visual), and seasonal price patterns (statistical).
STEP 2: TURN YOUR IDEA INTO A SET OF OBJECTIVE RULES
This is the most difficult step in our 5 step plan, much more dif­ficult 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 compre‑
hensive technical analysis software package available for formu­lating 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 EasyLanguageTM is no exception. The job with EasyLanguage, however, is greatly simplified because of the pro­gram'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 rela­tively 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 build­ing 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 method­ology 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 com­missions) 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 assump­tions change in the future.
I require my systems to work across:
• Different sets of parameters. If I were considering using a 5/20 moving average crossover system, then I would expect 6/18, 6/23, 4/21, and 5/19 to also perform reasonably well. If not, I immediately become skeptical of the 5/20 results.
· Different periods of time (e.g. 1990-95 and 1981-86). A system that tests well in the Japanese Yen over a recent five year period should also test reasonably well over any other five year interval. This is another area where I appear to hold the minority point of view.
· Many different markets. A system that has worked well in crude oil should also work well in heating oil and unlead­ed gasoline over the same period of time. If not, I will look for an explanation and will usually discard the system. I go even further than this, however, and test that same system across my entire database of markets, expecting it to per­form well in the majority of them.
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:
· Profit factor. Equals Gross profit on winning trades/Gross loss on losing trades. This statistic tells us how many dol­lars our system made for every $1 it lost, and is a measure
of risk. Long term traders should aim for profit factors of 2.00 or higher. Short term traders can accept slightly lower numbers.
· Avg trade (win & loss). This is our system's mathematical expectation. It should at least be high enough to cover transaction costs (slippage and commissions); otherwise we will be losing money.
· Max intraday drawdown. This is the biggest drop, in dol­lar terms, from an equity peak to an equity trough. I prefer to do this calculation on a percentage basis. I also differen­tiate between drawdowns from a standing start (where I am losing money from my own pocket) versus drawdowns from an equity peak (where I am giving back profits taken from the markets). I am usually more lenient with the latter.
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 hold­ing 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:
· they force you to do your homework before making a trade
· they provide a disciplined framework, making it easier for you to follow the rules
· they enable you to increase your level of diversificationWith 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.

0 comments

Make A Comment