Indicator · Pine Script v5 · Own pane

My QQE

by g-moe· code credited to goodgains

Calculates dual Quantitative Qualitative Estimation (QQE) oscillators paired with Bollinger Bands in a separate pane.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code91
Settings12inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago27 May 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

91 lines of Pine Script v5 from Tradingview/my-qqe.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

my-qqe.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains


//@version=5
indicator("my QQE", overlay = false)

// @keywords: my-qqe, dual-qqe-rsi, quantitative-qualitative-estimation, fast-atr-rsi-line, qqe-bollinger-bands, dual-rsi-smoothed, momentum-histogram, rsi-threshold-bands, wilders-atr-rsi, trend-band-cross, panel-oscillator, rsi-qqe-factor, column-momentum-plot, upper-lower-bb, dual-rsi-instance, smoothed-rsi-ema, rsi-deviation-bands, qqe-trend-state, momentum-bars, threshold-cross-signals

// qqe rsi 1
rsi_period_1      = input.int(6, title='RSI Length', group = 'RSI 1 Settings')
rsi_sf_1          = input(5, title='RSI Smoothing', group = 'RSI 1 Settings')
rsi_qqe_1         = input(3, title='Fast rsi_qqe Factor', group = 'RSI 1 Settings')
rsi_threshold_1   = input(3, title="Thresh-hold", group = 'RSI 1 Settings')
rsi_src_1         = input(close, title="RSI Source", group = 'RSI 1 Settings')
wilders_period_1  = rsi_period_1 * 2 - 1

rsi_value_1           = ta.rsi(rsi_src_1, rsi_period_1)
rsi_ma_1              = ta.ema(rsi_value_1, rsi_sf_1)
rsi_atr_1             = math.abs(rsi_ma_1[1] - rsi_ma_1)
rsi_ma_atr_1          = ta.ema(rsi_atr_1, wilders_period_1)
delta_fast_atrrsi_1   = ta.ema(rsi_ma_atr_1, wilders_period_1) * rsi_qqe_1

var float longband_1 = 0.0
var float shortband_1 = 0.0
var int trend_1 = 0
newshortband_1    = rsi_ma_1 + delta_fast_atrrsi_1
newlongband_1     = rsi_ma_1 - delta_fast_atrrsi_1
longband_1        := rsi_ma_1[1] > longband_1[1] and rsi_ma_1 > longband_1[1] ? math.max(longband_1[1], newlongband_1) : newlongband_1
shortband_1       := rsi_ma_1[1] < shortband_1[1] and rsi_ma_1 < shortband_1[1] ? math.min(shortband_1[1], newshortband_1) : newshortband_1
cross_1           = ta.cross(longband_1[1], rsi_ma_1)
trend_1           := ta.cross(rsi_ma_1, shortband_1[1]) ? 1 : cross_1 ? -1 : nz(trend_1[1], 1)
fast_atr_rsi_tl_1 = trend_1 == 1 ? longband_1 : shortband_1


// qqe bollinger band 1
length_1 = input.int(50, minval=1, title="Bollinger Length", group = 'BB Settings')
mult_1 = input.float(0.35, minval=0.001, maxval=5, step=0.1, title="BB Multiplier", group = 'BB Settings')
basis_1 = ta.sma(fast_atr_rsi_tl_1 - 50, length_1)
dev_1 = mult_1 * ta.stdev(fast_atr_rsi_tl_1 - 50, length_1)
upper_1 = basis_1 + dev_1
lower_1 = basis_1 - dev_1
color_bar_1 = rsi_ma_1 - 50 > upper_1 ? #00c3ff : rsi_ma_1 - 50 < lower_1 ? #ff0062 : color.gray



 

// qqe rsi 2
rsi_period_2      = input.int(6, title='RSI Length', group = 'RSI 2 Settings')
rsi_sf_2          = input(5, title='RSI Smoothing', group = 'RSI 2 Settings')
rsi_qqe_2         = input(3, title='Fast rsi_qqe Factor', group = 'RSI 2 Settings')
rsi_threshold_2   = input(3, title="Thresh-hold", group = 'RSI 2 Settings')
rsi_src_2         = input(close, title="RSI Source", group = 'RSI 2 Settings')
wilders_period_2  = rsi_period_2 * 2 - 1

rsi_value_2           = ta.rsi(rsi_src_2, rsi_period_2)
rsi_ma_2              = ta.ema(rsi_value_2, rsi_sf_2)
rsi_atr_2             = math.abs(rsi_ma_2[1] - rsi_ma_2)
rsi_ma_atr_2          = ta.ema(rsi_atr_2, wilders_period_2)
delta_fast_atrrsi_2   = ta.ema(rsi_ma_atr_2, wilders_period_2) * rsi_qqe_2

var float longband_2 = 0.0
var float shortband_2 = 0.0
var int trend_2 = 0
newshortband_2    = rsi_ma_2 + delta_fast_atrrsi_2
newlongband_2     = rsi_ma_2 - delta_fast_atrrsi_2
longband_2        := rsi_ma_2[1] > longband_2[1] and rsi_ma_2 > longband_2[1] ? math.max(longband_2[1], newlongband_2) : newlongband_2
shortband_2       := rsi_ma_2[1] < shortband_2[1] and rsi_ma_2 < shortband_2[1] ? math.min(shortband_2[1], newshortband_2) : newshortband_2
cross_2           = ta.cross(longband_2[1], rsi_ma_2)
trend_2           := ta.cross(rsi_ma_2, shortband_2[1]) ? 1 : cross_2 ? -1 : nz(trend_2[1], 1)
fast_atr_rsi_tl_2 = trend_2 == 1 ? longband_2 : shortband_2



hcolor2 = rsi_ma_2 - 50 > rsi_threshold_2 ? color.silver :
   rsi_ma_2 - 50 < 0 - rsi_threshold_2 ? color.silver : na

Greenbar1 = rsi_ma_2 - 50 > rsi_threshold_2
Greenbar2 = rsi_ma_1 - 50 > upper_1

Redbar1 = rsi_ma_2 - 50 < 0 - rsi_threshold_2
Redbar2 = rsi_ma_1 - 50 < lower_1
// plot(Greenbar1 and Greenbar2 == 1 ? rsi_ma_2 - 50 : na, title="rsi_qqe Up", style=plot.style_columns, color=#00c3ff)
// plot(Redbar1 and Redbar2 == 1 ? rsi_ma_2 - 50 : na, title="rsi_qqe Down", style=plot.style_columns, color=#ff0062)


plot_value = (rsi_ma_1-50)*1
plot_color = plot_value >= 50 ? color.lime : plot_value > 0 ? color.rgb(54, 156, 148)
 : plot_value <= -50 ? color.red : color.rgb(212, 98, 146)
plot(plot_value, color=plot_color, title='Momentum', style=plot.style_columns, linewidth = 3)

Overview

My QQE computes smoothed Relative Strength Index (RSI) values and tracks dynamic volatility bands based on Wilder-smoothed ATR of the RSI. A set of Bollinger Bands is applied to the centered trailing line to evaluate momentum extremes, coloring output based on band breakouts. Key settings configure RSI lengths, smoothing factors, QQE multipliers, and Bollinger Band periods.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

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.

Settings

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

SettingTypeDefaultVariable
RSI Lengthint6rsi_period_1
RSI Smoothingint5rsi_sf_1
Fast rsi_qqe Factorint3rsi_qqe_1
Thresh-holdint3rsi_threshold_1
RSI Sourcesourceclosersi_src_1
Bollinger Lengthint50length_1
BB Multiplierfloat0.35mult_1
RSI Lengthint6rsi_period_2
RSI Smoothingint5rsi_sf_2
Fast rsi_qqe Factorint3rsi_qqe_2
Thresh-holdint3rsi_threshold_2
RSI Sourcesourceclosersi_src_2
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

TTM Squeeze

by Alorse
330 stars

This indicator plots a TTM Squeeze momentum oscillator in a separate pane. It compares a Bollinger Band offset to a Keltner Channel offset and marks the zero line white when the difference is non-negative and black when the bands are inside the channel. A line

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of TTM Squeeze

Function - Logistic Equation

by ricardosantos79
261 stars

Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Function - Logistic Equation
228 stars

This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Bollinger Band Squeeze Detector

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V
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 6 weeks ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

Bubbles Indicator

by capissimo
114 stars

The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Bubbles Indicator

More Oscillators & momentum 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