Home / Toolkit / Edge QQE (14, 5, 4.236)
Free & open source · MIT

Edge QQE (14, 5, 4.236)

Long while the smoothed RSI holds above its QQE trailing band; flat when it loses the band. Signal at close, acted on next bar. The same class of signal sold in premium oscillator-suite momentum signals packages — except the code is below, and so are the receipts.

901
assets tested (daily bars)
17.9%
beat buy & hold out-of-sample
42.3%
median win rate (OOS)
0.38
median Sharpe (OOS)
Read the receipts before you trade it

On the median asset this rule underperformed buy-and-hold by 3.3% CAGR out-of-sample, with a median max drawdown of -53.1%. Arrows on a chart are not an edge — asset selection is. Use it where it's proven to hold up (below), skip it everywhere else. No one selling signals will print this paragraph; that's why we do.

Where it held up

Top assets by out-of-sample Sharpe

Where it failed worst

The loss column

The code

Full Pine Script source

TradingView → open the Pine Editor (bottom panel) → paste → "Add to chart". Settings: RSI 14 smoothed EMA 5, Wilder-length band EMA, factor 4.236.

//@version=5
// ─────────────────────────────────────────────────────────────────────────────
// Edge QQE (14, 5, 4.236) — free & open source. Part of the IndicatorEdge Edge Toolkit.
// Receipts (out-of-sample backtests across 700+ assets, incl. where it LOSES):
//   https://indicatoredge.io/toolkit/edge-qqe
// Same rule our engine tested: long while the smoothed RSI holds above its QQE
// trailing band; flat when it loses the band. Signal at close, act next bar.
// License: MIT. Educational/hypothetical — not financial advice.
// ─────────────────────────────────────────────────────────────────────────────
indicator("Edge QQE (14,5,4.236) — IndicatorEdge", overlay = false)

rsiLen = input.int(14, "RSI length", minval = 2)
sf     = input.int(5, "RSI smoothing (EMA)", minval = 1)
fac    = input.float(4.236, "Band factor", step = 0.001)

wilders = 2 * rsiLen - 1
rsima  = ta.ema(ta.rsi(close, rsiLen), sf)
atrRsi = math.abs(rsima - rsima[1])
dar    = ta.ema(ta.ema(atrRsi, wilders), wilders) * fac

// trailing long band — exact port of the engine loop
var float lb = 0.0
nb = rsima - dar
if not na(nb)
    lb := nz(rsima[1]) > lb ? math.max(lb, nb) : nb

long = rsima > lb

plot(rsima, "Smoothed RSI", color = long ? color.new(#2dd4bf, 0) : color.new(#f87171, 0), linewidth = 2)
plot(lb, "QQE trailing band", color = color.new(#94a3b8, 20))
hline(50, "Midline", color = color.new(#64748b, 60))
bgcolor(long ? color.new(#2dd4bf, 92) : na)

goLong = long and not long[1]
goFlat = not long and long[1]
plotshape(goLong, "Long signal", shape.triangleup,   location.bottom, color.new(#2dd4bf, 0), size = size.tiny)
plotshape(goFlat, "Exit signal", shape.triangledown, location.top,    color.new(#f87171, 0), size = size.tiny)

alertcondition(goLong, "Edge QQE — LONG", "Smoothed RSI reclaimed the QQE band (engine acts next bar open)")
alertcondition(goFlat, "Edge QQE — EXIT", "Smoothed RSI lost the QQE band (engine acts next bar open)")

Published stats were computed by our engine with this exact rule: long/flat, signal at bar close acted on the next bar, 0.08% costs per side, out-of-sample = final 30% of each asset's history. Educational information only — not investment advice. Hypothetical backtested results; past performance does not guarantee future results. Trading involves risk of loss.

More from the toolkit

Free · no spam

Get the weekly edge report

The best-performing indicator per asset, what changed this week, and the honest caveats — straight to your inbox.