BOLLINGER BANDS

Here I offer a simple trend-following breakout system where entry signals are triggered by the market closing beyond the upper or lower bands. The system exits open positions when markets revert to the mean (e.g., the 20-day simple moving average). Using CQG, the programming code for this Bollinger band breakout system is written in this way:

Long Entry:

Close(@)[-1] > BHI(@,Sim,20,2.00)[-1]

Short Entry:

Close(@)[-1] < BLO(@,Sim,20,2.00)[-1]

Long Exit and Short Exit set “Price” field to:

BMA(@,Sim,20)[-1]

Table 3.10 presents the backtested portfolio results from December 31, 1992, to December 31, 2002, for this system.

Notice that although this system suffered through 17 consecutive losses, the low correlation of assets within the portfolio still resulted in the endurance of a less severe worst drawdown than that experienced by trading the E-mini S&P 500 by itself.

Get Mechanical Trading Systems: Pairing Trader Psychology with Technical Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.