Donchian Mean Reversion Alerts
Jul 11, 2018

The Donchian Mean Reversion Alerts indicator provides a specialized framework for identifying mean reversion and trend continuation opportunities using asymmetric Donchian Channels and RSI filtering.
Usage
The tool can be utilized to identify two primary types of trading signals based on the interaction between price action and channel boundaries:
- Mean Reversion Signals: These occur when the price breaks outside the upper or lower Donchian boundaries while the RSI indicates an overbought or oversold condition. A Buy arrow appears when the price breaks below the lower band and RSI is below the Low threshold. A Sell arrow appears when the price breaks above the upper band and RSI is above the High threshold.
- Trend Continuation (Midline) Signals: In strong trending environments, the indicator identifies signals when price crosses the midline. An "Uptrend Buy" is triggered when a moving average of the source crosses under the basis, whereas a "Downtrend Sell" is triggered on a crossover.
Traders often use the opposite channel boundary as a stop-loss level. For example, in a long position, the lower Donchian line can serve as a trailing stop that adjusts dynamically with market volatility.
Details
This script is an evolution of the classic Donchian Channel, modified to allow independent period lengths for the upper and lower bands. This asymmetry allows traders to tune the indicator specifically for bullish or bearish volatility profiles.
The integration of an RSI filter helps mitigate false breakouts by ensuring that mean reversion signals only trigger when momentum is stretched. The "Midline Rule" is a tactical implementation where the basis line acts as a primary take-profit or break-even target before the price reaches the opposite extreme of the channel.
Settings
Donchian Channel Settings
- Upper Channel: Sets the lookback period for the highest high calculation.
- Lower Channel: Sets the lookback period for the lowest low calculation.
- Show Mid-Line?: Toggles the visibility of the central basis line.
- Show Arrows?: Enables or disables the primary mean reversion signal arrows.
- Show Arrows On Midline?: Enables or disables trend continuation signals on the midline.
- Source: Determines the data point used for the internal moving average calculation.
RSI Settings
- RSI Period Length: The lookback period used to calculate the Relative Strength Index.
- RSI High: The overbought threshold for filtering sell signals.
- RSI Low: The oversold threshold for filtering buy signals.
FAQ
How can I use the Donchian Mean Reversion Alerts for trend following?
While primarily designed for mean reversion, you can enable the "Show Arrows On Midline" setting to capture signals during strong trending environments when the price interacts with the channel basis.
Can I adjust the bands for different market conditions?
Yes, the script allows for separate adjustments of the upper and lower levels. If you expect a significant move upward, you might use a shorter upper length and a longer lower length to better define your risk and trailing stop.
How do I access this indicator?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.