Explainers / Support Resistance Channels
Support Resistance Channels, explained from the source
"Support Resistance Channels" by LonesomeTheBlue is one of the most-boosted free scripts on TradingView, with more than 48,000 boosts. It shades up to six horizontal zones: red above price, green below, grey when price is inside. The zones come from recent pivot highs and lows, they are recalculated whenever a new pivot confirms, and the ones on screen are stretched across the whole chart, including bars from before they existed. That last point is why the zones can look like price respected them for months.
How a zone is built
- Find pivots. A pivot high is a bar whose high is the highest of the 10 bars on each side (Pivot Period 10). It is only known 10 bars later, when the right side is complete.
- Group nearby pivots. For each pivot in the last 290 bars, every other pivot close enough joins it. "Close enough" means the group stays narrower than 5% of the 300-bar high-to-low range. That cap is a share of the recent range, not of price, so zones get wider in volatile stretches.
- Score each group. 20 points per pivot in it, plus 1 point for every bar in the last 290 whose high or low sits inside it.
- Pick the strongest. Take the highest-scoring group, drop every group that overlaps it, repeat. Up to six are shown by default.
- Colour by the current close. Red if the zone is entirely above the close, green if entirely below, grey if the close is inside.
Why the zones move
Steps 1 to 4 run again every time a new pivot confirms, which is roughly every couple of weeks of bars on a daily chart. In our simulation, with default settings:
- the set of zones on screen changed about every 17 to 18 bars;
- of the zones shown on any given bar, only about 1 in 5 was still there 100 bars later.
The script deletes the old zones rather than keeping them, and draws the new ones with "extend both", so each zone runs to the left edge of the chart. A zone created today is therefore shaded over bars from a year ago. Scrolling back does not show you what the indicator showed at the time; it shows today's zones over old prices. That is a display choice, not a data leak, but it makes the past look more orderly than it was. More in what repainting is.
The settings
| Setting | Default | What it does |
|---|---|---|
| Pivot Period | 10 | bars on each side for a pivot; also the confirmation delay |
| Source | High/Low | pivots from wicks, or from candle bodies (Close/Open) |
| Maximum Channel Width % | 5 | zone width cap, as a % of the 300-bar range |
| Minimum Strength | 1 | minimum score, in units of 20 points |
| Maximum Number of S/R | 6 | zones shown |
| Loopback Period | 290 | how far back pivots and touches are counted |
Minimum Strength 1 lets a single pivot make a zone. The setting's tooltip says a channel must contain at least 2 pivots, but 1 means 20 points, and one pivot is worth 20 by itself. In our simulation about 1 zone in 5 on screen came from a single pivot. Set it to 2 if you want the tooltip's behaviour.
The alerts
There are two: Resistance Broken and Support Broken. They fire when the close crosses the edge of any shown zone and is not inside another zone. With six zones on the chart that is frequent: about 1 bar in 6 in our simulation. Because the zones themselves change with each new pivot, a "break" can be of a zone that did not exist ten bars earlier. Alerts on an open bar can also fire and then vanish if the bar closes back inside.
Does it repaint?
The calculation uses no higher-timeframe data and no future bars. But three things change what you see after the fact: pivots appear 10 bars late, the whole set of zones is replaced when one does, and the new zones are drawn back over old bars. Judge it only on bars that came after a zone appeared. How to check a script yourself.
Where it fails
- Old bars show today's zones. Extend-both shading over history makes past "respect" of a zone look better than it was in real time.
- The zones turn over fast. About every 17 to 18 bars in our simulation, and 4 in 5 gone within 100 bars.
- One pivot can make a zone at the default Minimum Strength, despite the tooltip.
- Pivots are 10 bars late. A zone built from a pivot high appears 10 bars after the high.
- Width depends on the recent range. After a volatile spell the cap widens and zones can merge into broad bands.
- Breaks are frequent and unfiltered. About 1 bar in 6 crossed some zone edge in our simulation; there is no test here of whether any break meant anything.
Also explained: Pivot Points High Low · Volume Profile / Fixed Range · ZigZag · Repainting
Educational only. Not financial advice. Nothing here is a recommendation to buy or sell anything. Support Resistance Channels is by LonesomeTheBlue on TradingView, published under the Mozilla Public License 2.0; this page explains its published open-source code and is not affiliated with the author. Simulation figures come from synthetic random-walk prices and say nothing about how the indicator trades.
Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue
Get the next teardown by email
One short email when a new teardown or free tool goes live, about twice a month. No signals, no hype. Unsubscribe in one click.
Almost done. Check your inbox and click the confirmation link.
Sent with Kit. Your address is used only for these emails. Privacy
No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.