Trading Systems 101

The vast majority of traders in the market basically trade without much of a plan. Most believe that all you have to do to make money in the market is listen analyst recommendations or breaking news and then they will be set for life.

Wrong!

Everyone I know that has “played” the market using news from the talking heads on TV or the Internet has eventually lost their money and quit. If over 90% of the players in this game lose, and 90% use the news to trade…hmmmm…are we seeing a correlation here?

Trading was like playing a slot machine

Once upon a time, I too was caught up in scanning the news for trading ideas. Every now and then, I would catch a nice win or two, but it was like playing a slot machine – I would win just enough times to keep me playing.

I've always been an analytical type of person, so I began my search for a repeatable trading method. After reading several interviews of successful traders, I decided to go the computerized route. Many of the best traders in the world were using computerized systems to generate their buy and sell signals, and that fit in well with my idea of how trading should be.

10 years later…

That was a decade ago, and in that time, I've learned 10,000% more about trading systems and what makes them tick…

Trading System Philosophy

The philosophy of trading system design is to use the past to figure out the probability of something happening in the future. That doesn't mean we can predict the future – we can react to it however.

I think of trading as I do playing card games like poker. The big difference is that the rules for poker are very well established and repeatable. With the stock market, the rules aren't published, so I have to use the past to come up with the rules of how I think the game should be played. I put my ideas into a computer which in turn tells me if I would have done well (by making money) in the past with those sets of rules.

There's nothing new under the sun

The future is unknowable, but knowing what's happened in the past can give a glimpse into the probabilities of future outcomes. After all, human emotion is the same now as it was 1000 years ago (and I contend that it's these emotions that create edges for us to exploit in the markets).

The primary way to keep score in the stock market game is by how much money you make – not how often you're right or wrong. You see, if you won 30% of the time, but your winners were 3 times the size of your losers, you would be making money.

Most traders focus too much on their own ego instead of playing the game to make money. That's why even Einstein type brainiacs with bulging IQs fail at trading. When you get the emotion out of the picture and focus on playing the game on its terms, you can find a constant source of wealth.

Crunching the Numbers

It's really not just enough to make money from the market. I want to not only make a bunch of money, but I want to do so while keeping my drawdowns as small as possible. If I make 80% in one year, but I had to stomach a 60% drawdown during that time…well, that's not a good trading system. In fact, a trading system like that could very well make you lose all your money at some point in the future.

Tested Analysis

So how do we go about finding systems with potential? By testing, testing, and retesting. I like to say that I don't use technical analysis to find my trades; I use tested analysis.

I'll pour through charts for hours on end until I see what appears to be an edge. I'll then program my ideas into a computer (or computers depending on how much number crunching is required). Next, I'll refine the trading criteria by testing different combinations of the indicators I've fed to the computer.

All told, this process takes a VERY long time, as even my new computers have a hard time crunching data for thousands of stocks for 15+ years. If it's hard to do, then I know I'm on the right track. If it was easy, then everyone would be doing it and I wouldn't have an edge.

Enter gain/pain ratios and a plethora of other statistics.

One of the most common statistics to measure performance is the MAR ratio. Basically, you take your compound annual growth rate (CAGR) and divide by your worst drawdown during that time. So if my trading system has a CAGR of 50%, and my worst drawdown was 25%, then the MAR ratio is 2.0. The bigger the better.

In general, I've found that the shorter the timeframe and the more trades, the bigger the MAR. A very short-term trading system like our Profit Taker has a MAR around 3…even during the worst bear market since 1929. If you look at its equity curve with drawdowns, you will see that it's been a steady money maker.

 

When dealing with longer trading periods, the gain/pain ratios tend to get smaller. The benefit is that you trade less, and returns can be very large, but these systems take more of a hit from time to time. Trend following systems tend to have lower MAR ratios in the stock market.

Another important stat to me is the length of time between new equity peaks. I don't want to trade systems that go on more than 12 months before making a new equity high. It's very hard to stay focused after that long of a drawdown.

The MAR ratio is very easy to understand, but I find it lacking. Just knowing your growth rate and worst drawdown is not enough. I want to dive in and use a number that penalizes me for not only big drawdowns, but the length of time between new equity peaks. Peter Martin came up with the Ulcer index which does just that.

It gives numbers between 0 (a perfectly straight line with no drawdowns) and 100 (a system always in drawdown…which would sure give me an ulcer).

By going through your equity curve, it penalizes you by the drawdown squared each time you're below the equity peak. You can then take your annual growth rate and divide it by the Ulcer index. I think this is by far the best way to compare systems. Thank you Peter Martin.

Money Management

In order to make money while keeping risk low, you have to use proper money and risk management. Most see this as an after thought to trading. It's not! In fact, it should be thought of as the most important aspect of trading. If you risk too much and lose all your money, you're out of the game.

For every trade you make, you should know exactly how many shares you're going to buy, and how much money is at risk at any one point. For example, if you lose money on any one trade, perhaps it should not be more than 1% of your total portfolio. You could calculate how many shares to buy based on your entry price and stop price:

 

# Shares = (% Portfolio risk) * (Portfolio size) / (Buy price – Stop price)

So for a $50,000 portfolio risking 1% (or $500):

# Shares = (0.01) * ($50,000) / (25.45 – 23.04)

# Shares = 207

 

When trading stocks there is more to worry about than how much you're going to risk on any one trade. You see, stocks are highly correlated to each other. Not only are you risking money on each trade, but you're risking that all those stocks will fail at the same time. Therefore, you must limit the number of stocks a system is trading at any one time.

My testing has showed a very easy way to blend fixed fractional betting with risk management. Simply divide the money to risk evenly between 10 or more positions. For example:

 

# Shares = ( Portfolio size / 10 ) / Entry price

# Shares = ( $50,000 / 10) / (25.45)

# Shares = 196

 

Now, we have limited the number of positions (10) that can go against us, and we've reduced the maximum risk in case a stock went belly up (if one of our stocks went to zero, we would be out 10% max).

 

Statistical significance

One of the biggest errors I see people make when testing systems is statistical significance. Sometimes, a particular pattern will come up only 10-15 times in history. The results look great, but when applied to the real world, they fail. You see, I could randomly choose a particular stock and random date to buy on the open, then sell on the close. There are thousands of stocks, and about 250 trading days in a year. I bet I could find a few examples that win 100% of the time just due to random chance.

When I look for an edge in trading, I want to see many examples…not just a handful. When it comes to choosing from thousands of stocks, I want to see hundreds if not thousands of samples. That way I can determine that I have not simply come up with a random sampling of trades that just happens to work well.

The stock trading systems described on this web site all have thousands of samples for back testing – many more than actually listed since every system has a limit of 10 positions at any one time. The software I use filters out trades if the maximum number of positions is reached.

Curve fitting

I've seen this mistake over and over again. A trader gets a basic back testing package and proceeds to test which moving averages work for a particular stock. Ouch! This is a quick way to lose money. If you're only using one stock to calculate the optimized values, you're going to run into the problem outlined above (not enough samples for statistical significance).

One set of rules for thousands of stocks

If instead, you were to scan thousands of stocks for a few combinations that work for all of them…well that's a much more significant statistic. When I'm testing what works for stocks, I test them ALL. I want to use the same rules for thousands of stocks…only then do I believe I have discovered an edge.

Accounting for Commission, margin interest, and slippage

There are just way too many traders out there that do not realize just how much the extra expenses in trading amount to. The great news is that commissions are falling dramatically (interactivebrokers is down to 1/2 cent a share now). However, you still have to pay interest to your broker for using margin when buying or selling short, and you must account for slippage.

Slippage is the amount of money you lose when a stock does not trade exactly at your entry price. Say I place an order to buy at the open. The open was 20.00, but my fill price was 20.07. Your slippage is 7 cents times the number of shares bought (7 cents * 1000 shares = $70). I always include slippage when testing systems. I usually estimate slippage to be between 5-10% of the day's range. If a stock moved between 20.00 and 21.00, the slippage was most likely between 5-10 cents.

Eventually, it's very possible to move the market with your orders. There are two ways I combat this: by only trading liquid stocks that trade several million dollars worth of shares on average, and by using stop limit orders.

Stop limit orders allow you to place a ceiling on how much your willing to pay for a stock. For example, stock XYZ is trading at 19.00 and I place a stop limit order to buy at 20.00/20.06. When the stock hits 20.00, my order to buy at a limit of 20.06 is placed into the market.

System Trading Terms and Formulas

CAGR – Compound annual growth rate. It's no good to simply take your percentage gains and divide by time. If you made 50,000% over a 50 year period, that's not the same as saying you made 1,000% a year. You would apply a formula based on compound interest instead:

 

x Sqrt(Percent gain) – 1 (where x is the number of years)

(50) Sqrt(50,000%) – 1 = 13.23% (Note that I'm using the special xsquareRoot function found on most scientific calculators. I'm not multiplying by 50 in the example above).

MAR – A simple measure for gain to pain. Take the compound annual growth rate (CAGR) and divide by the worst drawdown. If I have a 50% CAGR, and my worst drawdown was 25%, my MAR ratio is 2.0.

Ulcer Index – Created by Peter Martin, this gain/pain stat ranges from 0-100. Zero would be a perfectly straight line with no drawdowns, while 100 would be straight down (thus giving you an ulcer). Both the depth and duration of a drawdown are measured.

 

I like this statistics model because unlike the MAR ratio, it does not over-penalize you for what by definition is a one time event (your worst drawdown). Please see this web site for more info.

Martin Ratio – By taking your CAGR and dividing by the Ulcer index, this number will give you a much better number to compare trading systems. Sharpe ratios, and MAR ratios are inferior comparison models in my opinion.