O'Reilly logo

Mechanical Trading Systems: Pairing Trader Psychology with Technical Analysis by Richard L. Weissman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

NONDIRECTIONALLY BIASED MEAN REVERSION SYSTEMS

Thus far we have examined only trend-following mean reversion systems. In reality, most mean reversion traders have no bias against countertrend trading. Thus, now I offer some nondirectionally biased mean reversion trading systems.

Bollinger Bands with ADX Filter

Although I am certain that there are instances in which ADX improves the performance of trend-following systems, in general I have found greater success with this indicator as a filter for mean reversion systems. Here we take the mean reversion Bollinger band system previously used and replace the 200-day moving average filter with ADX. This removes the directional or trend-following bias and replaces it with a filter that is intended to ensure a nontrending market condition.

In addition, as opposed to exiting with profits at the 20-day moving average, this system will exit based on a percentage of the asset's value at the time of trade initiation. Because certain assets are more volatile than others, we will set both the stop loss and profit exits at 2.5 percent of entry level for the E-mini S&P 500 and Japanese yen crosses. All other instruments will use a 1.25 percent move as the exit criteria.

Using CQG, the programming code for a Bollinger bands mean reversion system with ADX filter is written in this way:

Long Entry:

Close(@)[−1] XBELOW BLO(@,Sim,20,2)[−1] AND ADX(@,9)[−1] < 20

Long Exit—Condition #1 set “Price” field to:

EntryPrice(@,0,All,ThisTradeOnly)+(.0125* ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required