Indicator · Pine Script v4 · Own pane

BULL BEAR POWER TREND

by theonetrade· code credited to Dreadblitz

The BULL BEAR POWER TREND indicator calculates bullish and bearish power relative to 50-bar highs and lows, normalized by a 5-bar Average True Range.

View on GitHub

GitHub stars34on the repository
Pine versionv4older, still runs
Lines of code53
Settings2inputs
LicenceMIT
Last update2 weeks ago8 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

53 lines of Pine Script v4 from assets/indicator/bit-exact/bull_bear_power_trend_wjlDy5tV.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

bull_bear_power_trend_wjlDy5tV.pine
// © Dreadblitz
//@version=4
//
study("BULL BEAR POWER TREND", shorttitle = "BBPT", overlay=false)
//
reg_trend_on = input(false, "Activate Reg Trend Line")
length       = input(defval=8, title="🔹 Length Reg Trend line=", minval=1)
//
BullTrend_hist = 0.0
BearTrend_hist = 0.0

BullTrend = (close - lowest(low, 50)) / atr(5)
BearTrend = (highest(high, 50) - close) / atr(5)
BearTrend2= -1*BearTrend

Trend = BullTrend - BearTrend

hline(0, title='Nivel 0', color=#000000, linestyle=hline.style_solid, linewidth=1)
niv_0=plot(0, title='Nivel 0"', color=#000000, linewidth=1, style=plot.style_line, transp=100)
hline(2, title='Nivel 2', color=#008000, linestyle=hline.style_solid, linewidth=1)
niv_2=plot(2, title='Nivel 2', color=#008000, linewidth=1, style=plot.style_line, transp=100)
hline(-2, title='Nivel -2', color=#FF0000, linestyle=hline.style_solid, linewidth=1)
niv_22=plot(-2, title='Nivel -2"', color=#FF0000, linewidth=1, style=plot.style_line, transp=100)

a=plot(BullTrend, title='Bull Trend"', color=#008000, linewidth=2, style=plot.style_line, transp=0)
b=plot(BearTrend2, title='Bear Trend"', color=#FF0000, linewidth=2, style=plot.style_line, transp=0)

fill(a,niv_2, color=#008000, transp=50)
fill(b,niv_22, color=#FF0000, transp=50)
fill(niv_22,niv_2, color=color.white, transp=60)

plot(reg_trend_on == false?Trend:na, title='Trend', color=#000000, linewidth=1, style=plot.style_line, transp=0)

if BullTrend < 2
    BullTrend_hist := BullTrend -2
plot(BullTrend_hist, title='Bull Trend Hist', color=#FF0000, linewidth=1, style=plot.style_columns, transp=0)

if BearTrend2 > -2
    BearTrend_hist := BearTrend2 +2
plot(BearTrend_hist, title='Bull Trend Hist', color=#008000, linewidth=1, style=plot.style_columns, transp=0)
//alexgrover-Regression Line Formula
x = bar_index
y = Trend
x_ = sma(x, length)
y_ = sma(y, length)
mx = stdev(x, length)
my = stdev(y, length)
c = correlation(x, y, length)
slope = c * (my / mx)
inter = y_ - slope * x_
reg_trend = x * slope + inter
//
plot(reg_trend_on == true?reg_trend:na, title='Trend', color=#000000, linewidth=1, style=plot.style_line, transp=0)

Overview

BULL BEAR POWER TREND plots individual bull and bear lines alongside a net trend oscillator in a separate pane. Reference levels at 0, 2, and -2 help identify strength thresholds, accompanied by histogram fills. Users can toggle an optional linear regression line over a customizable length to smooth the overall trend trajectory.

Details

Published by

theonetrade on GitHub

Code credit

Dreadblitz, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Activate Reg Trend Lineboolfalsereg_trend_on
🔹 Length Reg Trend line=int8length
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

MultiIndicator

by capissimo
114 stars

MultiIndicator combines multiple technical indicators into a single separate pane to save chart space. It calculates and displays market regime detection based on ordinary least squares regression, a Holt exponential smoothing crossover, normalized RSI, ADX, a

Indicator v4 Oscillators & momentumTrend
Updated 2 years ago · None stated GitHub repository of MultiIndicator

This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups

Indicator v5 TrendVolatility & bands
Updated 2 years ago · GPL-3.0 GitHub repository of AI SuperTrend Clustering Oscillator [LuxAlgo]
29 stars

The Supertrended RSI [AlgoAlpha] indicator plots the Relative Strength Index combined with a Supertrend overlay in a separate indicator pane. It first computes standard RSI, with an optional Hull Moving Average smoothing step, and computes a secondary moving a

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · Custom licence GitHub repository of Supertrended RSI [AlgoAlpha]
24 stars

This indicator plots a smoothed stochastic oscillator in a separate pane, with K and D lines, a midsection background, and adjustable overbought and oversold levels. Optional highlights mark overbought or oversold breakouts and K/D crossovers, and ribbon filli

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · MPL-2.0 GitHub repository of Intermediate Stochastic

The Adaptive Cycle Detector estimates the dominant market cycle from WaveTrend oscillator zero-crossing frequency and applies smoothing to recommend adaptive indicator lengths. Fast markets with frequent crossings receive shorter lengths while slow swing marke

Indicator v6 Oscillators & momentumVolatility & bands
Updated 4 weeks ago · MIT GitHub repository of Adaptive Cycle Detector [WavesUnchained]

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers