Skip to main content
On this page

S&R Power Channel: Formula, Candle Counts, and Drawing Limits

· 5 min read
Pineify Team
Pine Script and AI trading workflow research team

Pineify's S&R Power Channel combines a rolling high/low range with ATR offsets and counts of bullish and bearish candles. The counts describe candle direction, not traded volume, order-flow imbalance, or the identity of buyers and sellers.

How to search for and add indicator pages in the Pineify editor

Calculation and defaults​

The implementation uses the selected Length to collect highs and lows, including the current bar. It also calculates half of ATR over 200 bars.

OutputCalculation
UpperHighest high in the window plus 0.5 × ATR(200)
LowerLowest low in the window minus 0.5 × ATR(200)
Buy PowerCount of bars whose close exceeds their open
Sell PowerCount of bars whose close is below their open
Drawn midpointAverage of Upper and Lower

Length defaults to 130 and Extend to 30. A doji with equal open and close contributes to neither power count. With a complete window, Buy Power plus Sell Power can therefore be less than Length. A large candle and a small candle each count as one under the same direction test.

The ATR period and multiplier are fixed in this implementation. Changing Length changes the range and count window, while Extend controls drawing placement. Extend does not forecast a future level or add future information to the calculation.

Understand the displayed bands​

The upper box extends down from Upper by twice the half-ATR value; the lower box extends up from Lower by the same amount. Thus the visible shaded zone is different from its outer line. The dotted midpoint is a derived display element.

On the last chart bar, the drawing code deletes and recreates horizontal lines, boxes, and labels across the selected historical span and into the right-side display area. These are current-window drawings. They are not a stored sequence of the levels that existed on every historical bar.

The current high, low, close, ATR, and candle counts can also change during an open realtime bar. A blanket claim that the indicator never repaints would hide these important display and timing behaviors. TradingView's repainting documentation explains several distinct meanings of that term.

Why a naive bounce rule can be impossible​

With positive ATR and a window that includes the current bar, Upper lies above the current high and Lower lies below the current low. The current bar therefore cannot touch those newly calculated outer lines. A rule that requires a same-bar touch of the current Lower or Upper may never trigger.

A test might instead refer to a previously known line, a frozen earlier channel, or the inner shaded-band boundary. Those are different rules and must be stated explicitly. Do not silently substitute one after inspecting backtest results.

Also avoid backtesting against today's horizontal drawing where it crosses older candles. That drawing uses the latest window, not necessarily the values available at those earlier timestamps.

Add and inspect the indicator​

Find Support and Resistance Power Channel in Pineify's Visual Editor, review Length and Extend, and generate the script. Inspect it in TradingView, resolve compiler messages, and compare the displayed outputs with a few manually checked bars.

How to search for and add indicator pages in the Pineify editor

Test sufficient warmup history for ATR(200), the behavior of short histories, and windows containing dojis. Review an open bar and then the closed bar. If you need historical signals, inspect the underlying series rather than inferring them from the last-bar boxes.

Build a strategy as a separate task​

Define which channel version is used, when it becomes known, what counts as a touch, and whether entry requires a closed-bar confirmation. Add position sizing, exits, transaction costs, and execution timing. Buy Power exceeding Sell Power only says more candles closed above their open in that window; it does not prove stronger demand or a higher chance of a successful bounce.

Compare any RSI, volume, or trend filter against an unchanged baseline. Keep a separate evaluation period and record all settings tried. There is no verified AAPL reversal-detection percentage or TSLA strategy win rate provided here, and no universal timeframe setting follows from the formula.

Is Buy Power actual buy volume?

No. It counts bullish candles. Sell Power counts bearish candles, and dojis count toward neither.

Does Extend predict where support will be?

No. It controls how far drawing objects extend on the chart. The level still comes from current and historical inputs.

Can I backtest a current-bar touch of the outer line?

With positive ATR, the current outer lines lie beyond the current bar's high and low. Specify a previous level or a different boundary if that is the rule you intend to study.

The Best Pine Script Generator