Saturday, September 26, 2009

A Few Lessons Learned From My First Trading System Development

I'm in the process of developing a mechanical trading system for a money manager; the basic logic is similar to that of the transition patterns I've described in numerous posts. I've learned a few useful lessons thus far.

What I can tell you so far in the development process is that tweaking the entry parameters has less impact on profitability than defining when to exit trades.

At least for the patterns that I'm testing, the advice to hold your winners and cut your losers does not fully hold water.

There is an optimal holding period that has remained stable over years of backtesting; that holding period is based on the conditional probability of trades being profitable at a defined exit criterion. If you hold winning trades too long, they revert to losers more often than they add to gains.

Conversely, if you exit a trade that goes against you too quickly, you risk missing your move more often than you avoid further losses.

The optimal holding periods are different for long and short trades.

The most effective way to cap losses that I've found is to cap holding period, not define a dollar or percentage stop loss. A good deal of performance improvement comes from capping holding periods and thereby avoiding large losing trades.

To benefit from a "let your winners run" philosophy, you need holding times greater than 20 days. Within a 20-day window, defining optimal points for exit and not extending holding times on winning trades works better.

If you define exits as signals in the opposite direction, so that the system is always in the market, you increase total profitability, but at the expense of increased heat taken on trades and increased variability in returns. That could make the system difficult to trade psychologically.

The quicker a signal goes your way, the more profitable it is to wait for a signal in the opposite direction to trigger an exit. Promising money management rules appear to follow from this observation.

The trading patterns and parameters do not work equally well across different stocks and asset classes. Trading the same idea in the same way across all instruments is inefficient in my backtesting.

It may well be that other system ideas would generate different conclusions. With the system ideas I'm testing, however, I'm finding that common trading wisdom, while commonsensical, is not necessarily accurate.

FWIW: The alpha version of the system--take with a grain of salt--is long the S&P 500 Index.
.

3 comments:

Dave said...

Nice post, Brett. I've been doing some extensive backtesting over the past several months and you're right - some of the common rules you hear sometimes just doesn't hold up to scrutiny. For example, a lot of candlestick patterns that you hear gurus touting are pretty much useful when trying to develop a trading system around.

I'd be interested to hear what tools you're using to develop your system.

PascoBill said...

Thanks for this post.

Like Dave, I've done some back testing lately, and agree strongly with many of your points. I'm glad to see that you don't mind trading different asset classes using different parameters. So many system developers insist that a good system must work well across different charts and time periods.

I'm working on a short-term system that tests well with most notes and bond futures, is ok with Russell 2000, but doesn't work well at all with Nasdaq 100 or S&P. The last two are just too noisy for my trend following break-out system.

And one of my most useful exits is time-based. Without that, winners reverse too often.

Radek said...

Brett, my system testing and trading confirms your observations, particularly the fact that my exists are what generates my profits.

One area where my testing differs is that the best parameters for longs and shorts are NOT significantly different (the optimal parameters differ only by 2 or 3 units within that particular degree of freedom). One possible explanation is that my system is intraday, so perhaps longs and shorts are more similar than on the swing scale.