|At our MetaStock user meetings, I have found there are more members who would like to design a trading system but haven't than there are members who have. I was asked to make a presentation on this subject, and this article represents the gist of that presentation. |
I started by reminding everyone that a word processor does not an author make (did Shakespeare have a computer?), nor does a spreadsheet a financial analyst make. You have to be able to do with pencil and paper whatever it is you want the computer to do. The computer is a tool that makes the job easier and quicker — it does not do the job for you.
When I asked the group attendees to describe the first steps of their systems, two of the six wannabes could not state in simple English what they wanted the system to do. Step 1? The four who were able to state their objectives did not know how to tell their computers to run the system. Step 2?
There are many steps to take and decisions to make to get to this phase of designing your trading system. But just to make sure we're all on the same page, let's define this system. There are many definitions, but the simplest is a mechanical program that generates buy and sell signals according to a set of rules without intervention from the investor. I'll classify the programs as one of two types: passive, wherein the program produces buy and sell signals and you then have to manually place orders with your broker; and active, wherein the program itself automatically places the orders. A caution for both types of programs: a lot can happen between the time you write your program and the moment when conditions are met. You could have a trade executed that you no longer want.
STEP 1: SELECT THE MARKET
· Trending — A well-defined trend, up or down, the longer the better
STEP 2: A REFRESHER COURSE
We can't discuss the 100 or so indicators available, but you are probably already using some combination of indicators that give you visual cues for decision-making, so you can build on those. Let's review a few examples:
STEP 3: DESIGNING THE TEMPLATE
Trading literature always tells us to experiment to find the indicators that suit our style and give the signals we want. Perhaps, for the first time, you will start changing parameters to see what difference it makes. For example, the MACD default is: short average=12, long average=26, signal=9. For some time, I have been using MACD with half those values: 6, 13, and 4.5. I get quicker reversals, which sometimes makes me think I have a leading indicator, but I also occasionally get whipsawed. I know of one program that uses 4, 13, and 8, respectively. I don't know where those parameters came from, but the author evidently has had good results.
The next steps convert the template you have designed into English (our original step 1). Your system syntax will use the IF... THEN logic. You may have already used this in Excel, which uses the IF-THEN-ELSE logic. Say you have a portfolio manager spreadsheet and want to indicate whether a stock has been held for a long or short period. In the cell next to the security, you would enter "If this stock has been held more than 366 days, then print an 'L' in this cell, else print an 'S.'" Your system statements will not have the Else option, however.
The system is written in two parts, the first of which is the Setup. This is a list of conditions that must be met before any further action can be taken. The second part is the Entry. This is a statement of how you will enter the market. The setup tells you that the gun is cocked; all conditions are right for your entry. The entry pulls the trigger. Keep in mind that too many conditions may result in no entry signal being given. Let's examine a few possible setups.
STEP 4: COMPOSING THE SETUP
I'll use my template as an example of a setup that may never occur. My system depends upon two conditions, both occurring while a third is in effect. If the PAR is currently long, I want a buy signal if DMI+ crosses above DMI-, indicating the possible start of an uptrend. However, I also want the ADX to be equal to or greater than 25 to assure that the uptrend is a strong one. This system has worked very well most times, but I have missed some good moves because the ADX did not exceed 25 until the trend was well under way.
Remember, no indicator works the way the books say they will all the time.
STEP 5: COMPOSING THE ENTRY
1 Buy the next bar at today's high plus 1 (make sure that the uptrend is continuing)
Be aware you can write an entry that will never be filled and cause you to miss a great move. For example, you may never have a gap opening but the price can go to the moon. Likewise, there may not be a pullback and the price may get away from you. Not getting three consecutive closes is no guarantee that the price is not going higher. Your entry should guarantee that you will capture every price move that the system is designed for.
Note: From here on, the information pertains to all users, not just MetaStock users.
STEP 6: EXECUTE THE COMMANDS
The general form of the syntax will be the same for most programs; however, the symbols and abbreviations used will be different, and the syntax of one program will not be recognized by another, which means they cannot be interchanged.
Here's an example of a stochastic crossover trading system logic:
Note that TradeStation syntax follows the English structure almost word for word. MetaStock's code is not as intuitive. However, neither can be written without following the user guide. Note also that TradeStation has a "crosses above" command, whereas MetaStock compares yesterday's stochastic (the -1) to today's. You will find that you don't have to do much typing, however. Most programs have a function menu listing all the symbols, commands, and indicators available. You click on an indicator and then paste it into the dialog box.
Finally, when it comes to designing a trading system — and knowing how to make it work — it's easier done than said. Just try it.
Rudy Teseo is a private securities, options, and currency trader, and has taught classes in option trading and stock charting. He can be reached at email@example.com.
Current and past articles from Working Money, The Investors' Magazine, can be found at Working-Money.com.