Explainers / Support and Resistance Power Channel by
Support and Resistance Power Channel by ChartPrime, explained from the source
Support and Resistance Power Channel is an open-source TradingView script by ChartPrime (about 23,300 boosts, published in May 2025). It draws a coloured zone at the top and bottom of recent price, a dotted midline, two "Power" numbers and a few diamond marks. This page walks through its published code in order, says what each part does, and ends with where it fails. It does not say what any zone or mark will do next.
The surprise: everything is drawn on the last bar only
Most indicators calculate on every bar and leave a trail you can scroll back through. This one does almost nothing until the newest bar on the chart. There it looks back over the last 130 bars, draws everything in one go, and deletes what it drew on the bar before. So the chart never shows where the zones were yesterday or last week. What you see is always today's picture, laid over old bars.
Step 1: the highest high and the lowest low
With the default first input of 130, the script collects the highs and lows of the last 130 bars and takes the highest high and the lowest low. That is the same thing as a 130-bar Donchian channel read at the latest bar. An X is placed on the bar that made the high and on the bar that made the low, and the two prices are printed to the right of the chart.
Step 2: the two zones
The script takes the 200-bar Average True Range and halves it. The top zone runs from that amount below the highest high to that amount above it. The bottom zone does the same around the lowest low. So each zone is one 200-bar ATR thick, centred on the extreme. A solid line marks the outer edge of each zone and runs a little further to the right. Because of the 200-bar ATR, the script needs at least 200 bars of history before it can draw.
Step 3: the midline
The dotted grey line is the plain average of the highest high and the lowest low, with its price printed beside it. It is the middle of the range, not an average of closes or of volume.
Step 4: Buy Power and Sell Power
Buy Power is the number of bars in the last 130 that closed above their open. Sell Power is the number that closed below their open. A bar that closed exactly at its open counts for neither. That is the whole calculation. Volume is not used, the size of the bars is not used, and where the bars sit in relation to the zones is not used. The Buy Power figure is printed inside the bottom zone and the Sell Power figure inside the top zone.
Step 5: the diamonds
The script walks back through the 130 bars. A diamond goes under a bar when that bar's low is above the bottom zone and the bar before it had a low at or below the top of the bottom zone: price was in the zone and then lifted out. A diamond goes above a bar when its high is below the top zone and the bar before it had a high at or above the bottom of the top zone. Both tests use the zone as it stands on the latest bar, not as it stood when those bars formed. The newest bar itself cannot get a diamond; the earliest it can appear is one bar late.
What the settings change
The first number (130) is how many bars the script looks back over. A larger number gives a taller channel that changes less often. The second number (30, allowed from 20 to 100) is how far the drawing extends to the right of the latest bar. The two colours change only appearance. The ATR length of 200 and the half-ATR zone size are fixed in the code and are not settings.
What we checked in Python
We ported the last-bar picture to Python and ran it on invented random-walk prices (3,000 bars, three seeds), rebuilding the picture on every bar as a freshly loaded chart would. The highest high or the lowest low changed on about 1 bar in 5, and each change moves a whole zone. Each zone was about 1.3% of price thick, inside a channel about 17% tall. There were 2 or 3 diamonds on screen at the median and at most 7 to 10. Of the diamonds on screen at any moment, 75% to 82% were still on the same bars 20 bars later, so roughly one in five had gone. Only 50% to 72% of them would also have been drawn on the bar right after they formed; the rest exist only because the zone moved to where it is now. Buy Power sat between about 54 and 75 out of 130 for most of the run, with a median of 64 or 65, on prices that were random by construction. These figures describe the code on invented data, not any market.
Where it fails
- No history to check. The zones, the midline, the Power numbers and the X marks are deleted and redrawn on every new bar. You cannot scroll back and see what the script showed at the time, so you cannot check by eye how past zones held up.
- The diamonds are placed with hindsight. Each diamond is tested against today's zone, which is built from bars that came after it. On invented prices, between 3 and 5 in 10 of the diamonds on screen would not have been drawn on the bar after they formed.
- Diamonds come and go. When a new high or low moves a zone, old bars are tested again against the new zone. On invented prices about one diamond in five was gone from its bar 20 bars later.
- The zones jump. A zone moves when price makes a new 130-bar extreme, and also when the old extreme becomes the 131st bar back and drops out of the window. The second kind of move happens with no new price action at the edge at all.
- Power is a candle count. Buy Power of 70 means 70 of the last 130 bars closed up. It says nothing about volume, about how far those bars moved, or about anything that happened at the zones. On random prices it still wandered between about 54 and 75.
- Support and resistance here are the range's edges. The script does not look for levels that price touched several times. It marks the single highest high and lowest low of the window, which is what a Donchian channel does.
- A label limit. The script allows itself 12 labels. Five are used for the prices and X marks, which leaves room for seven diamonds. The code never deletes diamonds itself, so on a live chart ones drawn against an earlier zone may stay until the limit clears them. This page read that from the code and did not check it on a chart.
- Some names in the code are swapped. The line the code calls "sup" is drawn at the top and the one it calls "res" at the bottom. It does not change the picture, but it matters if you copy the code.
- No alerts and no backtest. The code defines no alert conditions and measures nothing after a diamond.
- Open and licensed. The code carries a Mozilla Public License 2.0 notice and credits ChartPrime; this page describes it in our own words and pastes none of it.
Educational only. Not financial advice. Nothing here is a recommendation to buy or sell anything. Support and Resistance Power Channel is by ChartPrime on TradingView and carries a Mozilla Public License 2.0 notice; this page describes its published open-source code in our own words and is not affiliated with the author. Simulation figures come from synthetic random-walk prices and say nothing about how the script 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, Support Resistance Channels, 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 (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.