For the past two months I have been writing my own automated trading system. Two weeks ago I slowly started trading using manual techniques based on data generated by my software. The initial results are very good, but I am tempering down my glee because I was conservative and focused. It’s like those drugs you test to cure cancer that work in smaller trials, but fail in mass scale. My return has been about 33%, with 95% of the trades being in the money. Being the skeptic I am quite nervous about these results because they are too good to be true. Yet I see the monies in my brokerage account and think, interesting. Time will tell if my software is worth its money.

When I saw a column about automated trading systems I was interested. The column asked if trading systems will replace humans. Supposedly there are companies that can develop systems that create rules and generate about 20% return. Not a bad return, but I have funds that are doing better than that and do not use automated trading systems.

The question is if an automated trading system will replace human traders? Let’s say that Progress Apama is the best automated trading system since sliced bread. Why would a company like Progress not use it to trade themselves? This is a serious question that has to be asked. If an automated trading system can be written that generates a guaranteed income why would anybody offer it for sale? The company Progress could use it as a “money printing press” and retire. So right there one should be skeptical of anybody who offers a trading system that makes money. (For those wondering, I am not giving out my software nor the strategies used by it.)

Though there is a market for automated trading systems implying that people are interested in automated trading systems. There is a need, and the title of the HTML page from Progress Apama system says it clearly.

“Progress Apama – Monitor, Analyze, and Act on Events in Under a Millisecond”

The keywords are Act, Events, Millisecond. Humans cannot react to events under a millisecond. If you want to scalp on technical news you need an automated trading system. And Apama seems to be geared towards that market, and that I can understand. However, I would argue that Progress Apama is fighting a loosing battle. I have it from reliable sources that some traders want logic burned onto IC’s because software does not react fast enough for scalping purposes. (NOTE: I do not recommend scalping for the average trader as it seems the big trading houses have taken a bulleyes to this trading style.)

The basis of the Progress Apama software, if you listen to their on demand web casts is that you can generate rules dynamically and make complex decisions based on patterns. My opinion great, but it is not going to help you.

What I have learned from writing my own trading system is that there are no patterns. If there are patterns then they are changing and not reliable. For example one of the things I learned, and it runs counter to the opinions of many, is the need for a large history to properly back-test your trading strategy.

When I started writing my automated trading system I was frustrated that my broker Interactive Brokers provides only a year of history. Thinking that I needed more and more data I grabbed the full historical data from Yahoo. Yet that extra data is not necessary. A large history of a security is bad for your strategy.

The reason has to do with trading psychology. Let’s say that two years ago there was a pattern to buy. Traders will see the pattern and to make “real money” do the inverse and sell. As more and more traders see the pattern there will be more and more sellers invalidating the pattern. The signal of the pattern changes and your software will not know whether to buy or sell. Let’s put it to the brutal test. Would you want to use trading strategies from the pre-Internet bubble? NOT LIKELY!

This pattern inversion is why the markets are random walks. There are moments of markets inefficiency, but it is very hard to predict those moments. This is why some human traders are so good as they can sense these inefficiencies and know what action to take. To figure out the market many software products and automated trading systems attempt to cross-reference and correlate other information in the hopes of finding a pattern. Yet that extra information is useless because if that extra information establishes a pattern it will be exploited and thus loose its relevance. Patterns are a loosing battle!

When I initially read the book “Technical Analysis and the Financial Market” I learned the following fundamental rules.

  1. Market action discounts everything
  2. Prices move in trends.
  3. History repeats itself.

The first rule throws the relevance of extra information from additional data streams out the window. The first rule says that market action is a collective of all informations, and thus any other extra information is not going to help you. At first when I thought about this rule I thought it ain’t so. But in fact it is so, and my automated trading system illustrated it to me.

The second rule is one that we are all aware of and relates to the fact that once a trend has established itself it will keep going. The second rule is the basis of trend trading and I have no argument with this rule.

The third rule is that history repeats itself. I completely agree, but would be defeating my own argument and imply that companies like Progress Apama are correct. What I learned from my software is that history repeats itself, but how history plays out is different. Anybody who trades or invests will probably once or twice have said, “Hey this company is good so why are the stocks falling?”

What I have learned is that trading involves the combination of random walks, and technical analysis. The problem with combining these two strategies is that they are contradictory. Combining the two theories I am saying you can analyse a random event. Using the extreme case of lotteries it means I can predict what numbers are going to be drawn and as we all know that is impossible.

It is possible to combine the two and my software illustrates how it can be done by analysing the recent DELL earnings. Consider the following snapshot of the DELL analysis before and after the earnings. For reference purposes based on my trading software I implemented a strategy and made 50% overnight returns.

Until 21.11.2006 my software was saying the trading sentiment was negative. The first two columns after the date column are the feelings of traders, where in the short term some were undecided, and long term they were negative. The next two columns represent the short and long term actions of the traders which were negative. Moving along and skipping the numbers look at the number 23.36, which is a volatility number. In my trading system anything above 20 is very very high meaning that the stock could go in either direction.

What my data was telling me is that the traders were negative and undecided. How do you trade this situation? If you attempt to associate a pattern from a book like “Encyclopedia of Chart Patterns” with the situation then you will either be very right or very wrong. And if you are sure of the very right situation then you are probably doing insider trading. The only logical answer is that at this point the market is a random walk.

Longer term chart technicians would have had a bullish position on DELL since the trend was positive as illustrated by the following snapshot.

I agree the trend is bullish, but the earnings could have gone either way.

For example, AAPL was on a downward trend until July 2006, and then AAPL switched directions.

I am making the case for trend following when the stocks illustrate trend characteristics, but looking at GOOG since 2006 it has been doing a sideways push. You could have followed the shorter term trends, but then comes the question what is the appropriate trend length to follow?

The answer is you don’t know what the appropriate trend length is because the market is a random walk. Trend following does attempt to define boundaries of when to buy and sell. Yet even trend following has its problems. This goes back to my thinking that if there are patterns where traders make money, other traders will do the inverse and punish you for it.

From the books “Technical Analysis of the Financial Markets”, “Technical Analysis and the Active Trader”, “Trading for a Living”, and “Investments” and trading I am learning that the market;

  • discounts everything,
  • there are trends,
  • markets are random walks,
  • risk calculations are essential,
  • its not about software, but about the strategy.

When I troll the Interactive Broker bulletin boards many ask about automated trading systems. And the most common answer is, “first focus on the strategy, then on the software.” And guess what, they are right. Software is a tool to help you slice and dice the data, but it cannot trade for you. As a tip I recommend reading the books I mentioned because they are very insightful and interesting.