Aurobindo, in his comments asks about whipsaws & automated trading. You can read the comments Here .
These are my favorite subjects. So, here I start.
Whipsaws:
Aurobindo asks: How to avoid trades when market moves sideways.
Any system / method which is trend following will make money when the market is in a trend. In sideways, range bound markets, these systems lose money, sometimes giving up a lot of the accumulated gains. I have developed hundreds of systems over the past ten years, and traded many of them. Here are my experiences in a nutshell:
1. The best systems are trend following. This seems reasonable since trends will give money. If there is no trend, there is no gain.
2. Counter trend systems (trying to sell tops and buy bottoms) are a losers game. Larry Connors provides many ideas for counter trend systems in his books and website. My understanding is that he trades withoutstops. When you are trying to buy at a low, it is always possible that the market may dip one more time before the final low is made. You do not want to be stopped out at the worst possible time. I have never been able to develop mechanical systems based on this idea. I do not recommend any trading without protective stops.
3. Trend Following Systems give many whipsaws in range bound periods. This results in (a) large number of consecutive losses (b) large drawdowns. Together they create an environment in which you say to yourself “I will do anything except run a trend system”. Chances are, at the point of maximum pain the system is abandoned. That’s probably a sign that a strong trend is emerging!
4. Adding moving averages to the system will almost inevitably adversely affect the system performance. Do not filter with averages.
5. There is no formula which gives an answer to “how to avoid whipsaws”. If you are a trend trader, you have to live with whipsaws. But, here are some suggestions to reduce the pain.
(a) Trade one side of the market. Use a long term average to determine the trend. Then, take only those trades which are in the trend direction. This has the unfortunate affect of eliminating reversal trades which are often profitable, but that’s the way it is.
(b) Experiment with price filters. If long term trend is on your side then you will buy at x + 1. If your signal is against the long term trend then you will buy at x+2. You can develop simiar logic for exits.
(c) Develop systems which trade less but give a higher sharpe + profit factor, even when they have lower profits. Chances are they will have lower profits, but that’s okay. Have a number of systems with different logic. You can trade a combination of two or more systems which together will give you the same performance with less whipsaws.
(d) Experiment with time exits. This sometimes enhances the performance of trend following systems. Even if it does not, if it reduces the whipsaw periods you may like to consider it. Example: If it is Tuesday, then I will exit my system. Often, this forces you out of bad trades (good ones also!).
(e) Experiment with the ADX using a low period. Instead of 14 use 5 or 8. ADX tells us when the market is not trending. But often it prevents us from entering at the beginning of a trending move.
(f) understand there is a tradeoff. You want to accept most of the whipsaws since the idea is to catch the big moves. Filtering will prevent you from the big ones. If you can reduce some of the whipsaws, I feel that the job is well done.
Finally, I have to thank you for asking these interesting questions. I look forward to more of this.