All indicators

Sideways Strategy DMI + Bollinger Bands

May 18, 2022

Static chart image
SignalsMoving AveragesVolatility

The Sideways Strategy DMI + Bollinger Bands tool identifies non-trending market environments to execute mean-reversion trades using a combination of volatility bands and directional movement filters.

Usage

This strategy is designed for markets moving sideways, where trend-following systems typically fail. It utilizes short-term trades with quick entries and exits based on mean-reversion logic.

  • Entry Signal: The strategy enters a long position when the Directional Movement Index (DMI) indicates a sideways market (the absolute difference between +DI and -DI is below 20) and the price crosses above the lower Bollinger Band.
  • Exit Signal: The position is closed when the price crosses back down below the upper Bollinger Band, suggesting the mean-reversion move has been exhausted.

The strategy is optimized for medium timeframes, such as the 1-hour chart. While it can be applied to shorter timeframes, users should expect higher volatility and more frequent signals.

Details

The script combines two core technical analysis concepts to filter for range-bound conditions:

  1. Market Regime Filtering: By calculating the absolute difference between Positive and Negative DMI, the script determines if a trend is weak enough to be considered "sideways." A difference of less than 20 typically signifies a lack of strong directional momentum.
  2. Mean Reversion: Bollinger Bands serve as the execution trigger. The lower band acts as a dynamic support level for entries, while the upper band acts as a dynamic resistance level for exits.

Settings

Date Range

  • From Month/Day/Year: Sets the starting point for the backtesting period.
  • Thru Month/Day/Year: Sets the end point for the backtesting period.
  • Show Date Range: Toggles the visibility of the date range filter.

Bollinger Bands

  • BB Length: The period used to calculate the basis (SMA) and standard deviation for the bands.
  • Source: The price data used for the calculation (default is Close).
  • StdDev: The multiplier for the standard deviation, determining the width of the bands.
  • Offset: Shifts the Bollinger Bands forward or backward on the chart.

FAQ

How do I use the Sideways Strategy DMI + Bollinger Bands?

Apply the indicator to your chart and look for long entries when the price bounces off the lower Bollinger Band while the DMI difference is low. The strategy is best used in non-trending or range-bound markets.

What timeframes work best for this strategy?

Based on historical testing, the 1-hour timeframe provides a balance between signal frequency and reliability. It can be adapted to other timeframes depending on the asset's volatility.

How can I access this script?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.