Free: indicator teardowns, a repaint checker and open-source scripts. No buy/sell signals, ever.

Taught to TradeSystems over signals.

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

  1. 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.
  2. 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.
  3. 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.
  4. Pick the strongest. Take the highest-scoring group, drop every group that overlaps it, repeat. Up to six are shown by default.
  5. 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 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

SettingDefaultWhat it does
Pivot Period10bars on each side for a pivot; also the confirmation delay
SourceHigh/Lowpivots from wicks, or from candle bodies (Close/Open)
Maximum Channel Width %5zone width cap, as a % of the 300-bar range
Minimum Strength1minimum score, in units of 20 points
Maximum Number of S/R6zones shown
Loopback Period290how 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

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

Next steps

  • Get a script fixed. Compiles but behaves differently live, or changes after a reload? In a Pine Script Audit, an AI model reads every line and writes a report on what to fix for $49, or also fixes those problems for $149. It cannot prove a script is safe.
  • Check your own script. Paste its source into the free repaint checker. It runs in your browser and flags known patterns.
Subscribe to the Teardown Letter: $19/moBack to Taught to Trade

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.