donchain support&resistance levels
Apr 7, 2021

The donchain support&resistance levels indicator identifies significant price levels based on Donchian Channel midpoints that remain stationary for extended periods, highlighting potential zones for price bounces and reversals.
Usage
The tool can be used to identify key support and resistance zones across multiple timeframes. Users can look for price interactions at the horizontal lines generated when the Donchian midpoint remains flat for a specific "Candle Count" (duration). A flat midpoint suggests a period of consolidation or a lack of new highs/lows, which often transforms into a strong level for future bounces.
Additionally, the indicator can be used to spot potential pullbacks. When a significant spread occurs between different identified levels (e.g., between the first and second line), it often indicates an overextended move that may lead to a price retracement.
Details
The script operates by calculating the Donchian Channel midpoint (the average of the highest high and lowest low over a lookback period). The core logic monitors these midpoints for stability; if the value remains unchanged for a user-defined number of candles, the script draws a horizontal line extended to the right.
This implementation supports up to four independent calculation modules, each with its own timeframe (Resolution) and period settings. This multi-timeframe capability allows traders to see daily or 4-hour levels directly on lower-timeframe charts.
Settings
The indicator includes four identical setting groups, allowing for granular control over different S/R levels:
- Setting Toggle: Enables or disables the specific level calculation.
- Period: The lookback period used for the Donchian Channel calculation.
- Resolution: The timeframe from which the data is pulled (e.g., Daily, 240m).
- Line Count: Determines how many historical levels for this specific setting remain visible on the chart.
- Color: Customizes the visual color of the lines and labels.
- Candle Count: The minimum number of bars the Donchian midpoint must remain flat before a level is confirmed.
- Show donchain line: When enabled, plots the continuous Donchian midpoint line instead of just the horizontal S/R levels.
FAQ
How do I use the "Candle Count" setting?
The Candle Count setting determines the significance of a level. A higher number means the price must stay within a range for longer before the midpoint is considered a valid support or resistance level.
Can I track levels from different timeframes?
Yes, by using the "Resolution" input in any of the four settings groups, you can plot levels from higher timeframes (like Weekly or Daily) on your current chart.
How can I access donchain support&resistance levels?
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.