All indicators

Moving Regression Band Breakout strategy

Feb 19, 2021

Static chart image
Price Action BasedSignalsChannelsVolatility

The Moving Regression Band Breakout strategy indicator provides a systematic approach to trading channel breakouts using advanced polynomial regression. It aims to capture trending movements by identifying when price action deviates significantly from its predicted mean, while offering flexible exit mechanisms to protect capital.

Usage

The strategy is primarily used to identify trend initiation through band breakouts. Examples of its application include:

  • Long Entries: A long position is triggered when a candle closes above the upper band. Users can optionally filter these entries to only occur when the slope of the Moving Regression curve is positive to ensure trend alignment.
  • Short Entries: A short position is initiated when a candle closes below the lower band. Similar to long entries, a negative slope filter can be applied for added confirmation.
  • Exit Logic: The strategy provides three distinct support/resistance levels for exiting positions: the central line, the opposite band, or the opposite band adjusted by a 14-period ATR.
  • Risk Management: A dynamic stop loss is implemented at the chosen support/resistance line. If the support line moves above the entry price for a long (or below for a short), the stop loss automatically shifts to breakeven to lock in protection.

Details

The script is built upon Moving Regression Prediction Bands, which utilize Local Polynomial Regression to model price action. Unlike standard linear regressions, this model adapts to local curvature, providing a smoother and more responsive baseline. The "Prediction" aspect comes from calculating the expected value for the next period, which serves as the central axis for the bands. The bands themselves are constructed by applying a multiplier to the Mean Absolute Error (MAE) of the regression model, creating a volatility-adjusted channel.

Settings

Model Parameters

  • Source: The price data used for the regression calculation (default is Close).
  • Local Polynomial Degree: Defines the order of the polynomial; higher degrees allow the model to follow complex price movements more closely but may increase noise.
  • Length: The lookback window for the regression calculation.
  • Multiplier: Adjusts the width of the bands based on the model's error.

Strategy Conditions

  • Allow Long/Short Entries: Toggles for enabling specific trade directions.
  • Exit Long/Short At: Dropdown menu to select the exit trigger (Lower/Upper Band, ATR-adjusted Band, or Central Line).
  • Enter Only When MR Slope is Positive/Negative: A trend filter that requires the regression line to be pointing in the direction of the trade.

Visuals & Backtesting

  • Fixed Backtest Period: Allows users to define specific start and end dates for historical performance analysis.
  • Show Stop-Loss Line: Visualizes the current active stop-loss level on the chart.
  • Show Breakout Signals Labels: Displays icons on the chart when entry conditions are met.

FAQ

  • How do I interpret the central line? The central line represents the previous period's prediction for the current price. When the price is significantly above or below this while breaking the bands, it indicates a momentum shift.
  • What is the benefit of the Polynomial Degree setting? A degree of 0 acts like a simple moving average, while a degree of 2 or higher allows the indicator to "bend" with the price, reducing lag during trend reversals.
  • How can I access Moving Regression Band Breakout strategy? 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.