Friday, March 30, 2007

Have a trading system?

This is a chart comparing the Dow Jones Industrial Average to the 30 year interest rate of the U.S.Treasury Bond. Today everyone is watching the Federal Reserve to see what hints they can attain from the wording in every speech and meetings they have. The addiction to declining interest rates has lead to an entire industry of analysts that have kinds macro models and crystal balls to help tell the future on where rates are headed. The reason that this industry of interest rate pundits can take up so much press time in news papers and television is the simple fact that very little in our country is purchased outright, it is borrowed. We will gladly pay you next Tuesday for a hamburger today. Way to go Wimpy.

How low do rates need to be for businesses to function efficiently and consumers to be able to live within their means? If consumers want to live beyond their means, then it makes sense that rates can never be low enough. The auto industry got to the point they offered consumers 0% rates and cash back to purchase cars and trucks. Consumers and businesses do not feel the effects of the dangers of existing in a leveraged/borrowed-to-the-gills environment, until one of the many balls they are juggling starts to fall. When this happens, we get to listen to the pundits and economists talk about the soft landing. There is never a soft landing, just a delayed crash landing. If the small amounts that rates have gone up since 2005 and into 2006 have caused the issues we are dealing with in the real estate market, the problem isn't interest rates; it's unrealistic purchases-- and the government does enough of that for all of us. Ready for the soft landing?


With the use of computers, it has become easier and easier to scan market data for specific data and patterns of data. This data can be from the fundamental facts of a company, or technical price data from the trading of the company's stock. This abundance of data has made it possible to compile lists of stocks with great fundamental qualities and then test certain perimeters to see what happens when the stocks perform best.

One way to approach trading is to try to make it automated. This is where the trader/investor picks certain indicators and price patterns, and lets the computer scan through all the data and create a list of stocks. These stocks can be traded on a discretionary basis or through the use of an automated buy and sell orders.

There are various software systems on the market that can test a trader's/investor's theory on what indicators and conditions work best. Technical analysis can often turn into witch magic, where facts and information is read into the data which is not actually there. There is a risk of having the bias become too strong, and then the pitfalls of a system are ignored or minimized. It is very important to be positive about a trading idea, but know it inside and out. Know the weaknesses as well as, if not better than, the strengths. Below is a simple example to show how these ideas are tested.

In this example we will use the S&P 100 Index component stocks. This is used for simplicity, not to make a comment on this group.

The system will buy when:

1.a stock makes a new 4day high.
2.the volume on this day is greater than the day before.
3.the close of this day has to be in the top of the range for the day.
4.the stock has to be greater than the 34day exponential moving average.

The system will sell when:
1. the stock makes a 20% gain. OR
2. the 3day exponential moving average crosses below the 8day exp. moving avg.

This is a very simple concept,used to show the idea.Do not use this system. The dates used start 4/5/2005 and end 3/29/2007. Here are the results:

As you can see, this system has some good winners and some dogs. Another point to consider is the median winner in the system. If over a two year span of data, there are a lot of 1 and 2 point winners; that might not be what you are looking for. A trader might like more trades, while an investor would want less trades and more trends. The system built depends a lot on the personality of the trader or investor.

Have any ideas or concepts you want tested? Leave a comment or click the question button above and send an email. If they are not overly complicated, I will test them and email you back the results.


These are the results if the system was applied using a $100k account and you divided the account into 10 positions; $10k per position. The commissions are $5 for each side of the trade. No margin was used. The problem with this data, is it does not take into account which 10 positions that could be held at a given time. It is just running the theory and how it effects each stock in the OEX. To see the results on an aggregate basis, this data would need to be exported to Excel and ranked by date to determine which 10 positions would be held at any given time. This has not been done with this data.

Personal experience has shown, that developing a system is not an easy task. It is not as easy as applying a couple indicators and ending up with the holy grail. Having an entry that is generated by a pattern(triangle,4day new high,ect), and then an exit generated by an indicator seems to work. This works in the reverse, but the results for using a simple moving average cross over seems like it would work, but it doesn't have the results one would think. Another point that seemed to work, is to take the day perimeters of a system, and then apply them to intra day data. An example would be like taking a 5day moving average, and then converting it to apply to 45min bars. The new moving average would be 45 period moving average when applied to the 9 45min bars that make up a trading day. This allows the system to enter and exit intra day, often resulting in better results.

This is the results for AA. It performed better than the buy and hold figure. This was one of the exceptions in this test. A good system should outperform the buy and hold index. A good system should have some other characteristics, which will be covered later.

The next post will deal with the writing of a scan for a specific chart pattern, which can be used to set up an entry. This can be combined with any number of indicators.


Anonymous said...

Two questions:

1. Have you backtested this model with some starting balance (say 100K). At any moment in time, you may or may not have capital available to make a trade. Factoring in commissions, etc, what would the outcome be?

2. Generally, how would one connect to an automated system?

Mike1 said...

I will run the same model on a $100k dollar basis. You limit the number of positions you can have at one time. Once you are in say 5 positions, if that is your max, it will ignore signals until capital is available. I will also set it not to use margin. The commission rate I will use will be $5 per side.

The system I used here as an example is not a great system. It was just an example. If you have something you want to try, let me know.

As far as running the system real time, tradestation offers automated trading. I have also used weath lab that I believe Fidelity offers now. Etrade is running commercials now that look like they have some sort of trade automation, but that could just be exit/stop orders.

You can also write a macro within msexcel and link this to some trading platforms. I have only used 2 with this method. One was for futures only. The other was through the Rediplus system.

If you have any other questions, let me know. I will run this system again tonight and post the results.



mfcurtis said...

Thanks Mike, I'm looking into building a simple model using some historical tick data from the NYSE / NASDAQ. The goal is to build a framework that will "select" the best model for a given data set. It's interesting to see what others use as parameters (moving averages, volume, etc) and it'll be interesting to see the outcome of your test.

I don't have a trading platform right now. If the analysis becomes viable, then I'll look into your suggestions.

Thanks again!