Topic: 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* EntryPrice(@,0,All, ThisTradeOnly))
Long Exit—Condition #2 set “Price” field to:
EntryPrice(@,0,All,ThisTradeOnly)–(.0125* EntryPrice(@,0,All, ThisTradeOnly))
Short Entry:
Close(@)[–1] XABOVE BHI(@,Sim,20,2)[–1] AND ADX(@,9)[–1] < 20
Mean Reversion Systems 81
04Weissman_073_088 10/6/04 11:18 AM Page 81
Short Exit—Condition #1 set “Price” field to:
EntryPrice(@,0,All,ThisTradeOnly)–(.0125* EntryPrice(@,0,All,ThisTradeOnly))
Short Exit—Condition #2 set “Price” field to:
EntryPrice(@,0,All,ThisTradeOnly)+(.0125* EntryPrice(@,0,All, ThisTradeOnly))
I can't get the code right:
[Strategy Properties]
A same direction signal - Does nothing
An opposite direction signal - Does nothing
Permanent Stop Loss - None
Permanent Take Profit - None
Break Even - None[Opening Point of the Position]
Bar Opening
Enter the market at the beginning of the bar
Base price - Open[Opening Logic Condition]
Better Bollinger bands
The bar opens below the Lower Band after opening above it
Smoothing method - Simple
Base price - Close
Period - 20
Multiplier - 2.00
Use previous bar value - Yes[Opening Logic Condition]
ADX
The ADX crosses the Level line upward
Smoothing method - Exponential
Base price - Bar range
Period - 9
Level - 20
Use previous bar value - Yes[Closing Point of the Position]
Account Percent Stop
Limit the risk to percent of the account
Account percent - 2
How do I close at a 1.25% move?