Indicator · Pine Script v6 · Own pane

QQE + AK Trend + EFI Combined

by realanthonyc· code credited to Anthony

This indicator combines Qualitative Quantitative Estimation (QQE), the AK Trend Line, and Elder's Force Index (EFI) into a single separate pane tool.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code115
Settings17inputs
LicenceMPL-2.0
Last update10 months ago4 Dec 2025

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

115 lines of Pine Script v6 from Archive/qqe-ak-trend-v1.3.2.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

qqe-ak-trend-v1.3.2.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Anthony C. https://x.com/anthonycxc

//@version=6
// -------------------------------------------------------------------------
//  QQE + AK Trend + EFI Combined
//  - QQE instance
//  - Wilder's smoothing (ta.rma) for ATR-of-RSI
//  - AK Scale Factor based on timeframe
//  - Elder Force Index (EFI) with normalization to match scales
//  v1.3.2
// -------------------------------------------------------------------------
indicator("QQE + AK Trend + EFI Combined", shorttitle="QQE + AK + EFI", overlay=false, max_lines_count=1, max_bars_back=800)

// === QQE Settings ===
rsiLengthPrimary     = input.int(6,   "RSI Length",     minval=1, group="QQE Settings")
rsiSmoothingPrimary  = input.int(5,   "RSI Smoothing",  minval=1, group="QQE Settings")
qqeFactorPrimary     = input.float(2.0, "QQE Factor",   minval=0.1, step=0.1, tooltip="Lower = smoother QQE band.", group="QQE Settings")
thresholdPrimary     = input.float(10.0, "Threshold",   minval=0.1, step=0.1, tooltip="RSI distance from 50 to color histogram.", group="QQE Settings")
sourcePrimary        = input.source(close, "RSI Source", group="QQE Settings")
atrLen               = input.int(14, "ATR Length for QQE (Wilder)", minval=1, group="QQE Settings")

// === AK Trend Settings ===
showAkTrend          = input.bool(true, "Compute and Show AK Trend Line", group="AK Trend Settings")
input1               = input.int(3,  "Fast EMA 1", minval=1, group="AK Trend Settings")
input2               = input.int(8,  "Fast EMA 2", minval=1, group="AK Trend Settings")
ak_scale_less_15m    = input.float(28.0, "AK Scale Factor (<15m)", minval=0.1, step=0.1, tooltip="Scale factor for timeframes less than 15 minutes", group="AK Trend Settings")
ak_scale_15m_1h      = input.float(16.0, "AK Scale Factor (15m-1h)", minval=0.1, step=0.1, tooltip="Scale factor for timeframes between 15 minutes and 1 hour", group="AK Trend Settings")
ak_scale_1h_1d       = input.float(8.0,  "AK Scale Factor (>1h-1d)", minval=0.1, step=0.1, tooltip="Scale factor for timeframes between 1 hour and 1 day", group="AK Trend Settings")
ak_scale_above_1d    = input.float(3.0,  "AK Scale Factor (>1d)", minval=0.1, step=0.1, tooltip="Scale factor for timeframes above 1 day", group="AK Trend Settings")

// === EFI Settings ===
efiLength            = input.int(13, "EFI Length", minval=1, group="EFI Settings")
normalizeEfi         = input.bool(true, "Normalize EFI", tooltip="Normalize EFI to prevent scale mismatch with QQE/AK.", group="EFI Settings")
normalizeLength      = input.int(200, "EFI Normalize Length", minval=1, tooltip="Smoothing length for EFI normalization.", group="EFI Settings")
targetAmplitude      = input.float(10.0, "EFI Target Amplitude", minval=0.1, step=0.1, tooltip="Target range for normalized EFI (e.g., +/-10).", group="EFI Settings")

// === AK Scale Factor based on timeframe ===
getAkScaleFactor(_less_15m, _15m_1h, _1h_1d, _above_1d) =>
    timeframeInMinutes = timeframe.period == "1" ? 1 :
                         timeframe.period == "5" ? 5 :
                         timeframe.period == "15" ? 15 :
                         timeframe.period == "30" ? 30 :
                         timeframe.period == "60" ? 60 :
                         timeframe.period == "240" ? 240 :
                         timeframe.period == "D" ? 1440 : 1440
    akScale = timeframeInMinutes < 15 ? _less_15m :
              timeframeInMinutes <= 60 ? _15m_1h :
              timeframeInMinutes <= 1440 ? _1h_1d : _above_1d
    akScale

ak_scale = getAkScaleFactor(ak_scale_less_15m, ak_scale_15m_1h, ak_scale_1h_1d, ak_scale_above_1d)

// === Calculate QQE (Single) ===
calculateQQE(_src, _rsiLen, _sLen, _qqeFactor, _atrLen) =>
    // RSI and smoothing
    _rsi         = ta.rsi(_src, _rsiLen)
    _smoothedRsi = ta.ema(_rsi, _sLen)

    // ATR of RSI via Wilder's smoothing (classic QQE style)
    _atrRsi = math.abs(_smoothedRsi - _smoothedRsi[1])
    _atrW   = ta.rma(_atrRsi, _atrLen)
    _delta  = _atrW * _qqeFactor

    // Bands with proper initialization using nz()
    var float _longBand = na
    var float _shortBand = na
    var int   _trendDir  = 0

    _newShort = _smoothedRsi + _delta
    _newLong  = _smoothedRsi - _delta

    _longPrev  = nz(_longBand[1],  _newLong)
    _shortPrev = nz(_shortBand[1], _newShort)

    _longBand  := _smoothedRsi > _longPrev  ? math.max(_longPrev,  _newLong)  : _newLong
    _shortBand := _smoothedRsi < _shortPrev ? math.min(_shortPrev, _newShort) : _newShort

    // Trend direction with explicit edge checks; seed with nz()
    _crossUp = _smoothedRsi > _shortPrev and _smoothedRsi[1] <= _shortPrev
    _crossDn = _smoothedRsi < _longPrev  and _smoothedRsi[1] >= _longPrev
    _trendDir := _crossUp ? 1 : _crossDn ? -1 : nz(_trendDir[1], 0)

    _qqeTrendLine = _trendDir == 1 ? _longBand : _shortBand
    [_qqeTrendLine, _smoothedRsi - 50]  // return QQE trend (unshifted) and RSI shifted to 0

// === Main Calculations ===
[qqeTrend, rsi0] = calculateQQE(sourcePrimary, rsiLengthPrimary, rsiSmoothingPrimary, qqeFactorPrimary, atrLen)

// AK Trend (compute only when shown)
fastmaa = showAkTrend ? ta.ema(close, input1) : na
fastmab = showAkTrend ? ta.ema(close, input2) : na
bspread = showAkTrend ? (fastmaa - fastmab) * 1.001 : na
akTrendColor = bspread > 0 ? color.rgb(5, 152, 5) : color.rgb(180, 0, 0)

// EFI Calculation
efi = ta.ema(ta.change(close) * volume, efiLength)

// Normalize EFI if enabled
smoothAbsEfi = ta.rma(math.abs(efi), normalizeLength)
normalizedEfi = normalizeEfi and smoothAbsEfi != 0 ? (efi / smoothAbsEfi) * targetAmplitude : efi

// === Plotting ===

// RSI histogram (shifted RSI around 0, middle layer, using QQE Signals' opaque colors)
rsiColor = rsi0 >  thresholdPrimary ? color.rgb(144, 238, 144) :
           rsi0 < -thresholdPrimary ? color.rgb(255, 99, 71) :
                                      color.rgb(112, 112, 112, 50)
plot(rsi0, color=rsiColor, title="RSI Histogram (Primary)", style=plot.style_columns)

// EFI line (bottom layer)
plot(normalizedEfi, color=#F44336, title="Elder Force Index")

// AK Trend line (top layer, draw only when requested)
plot(showAkTrend ? bspread * ak_scale : na, title="AK Trend Line", color=akTrendColor, linewidth=2)

Overview

QQE + AK Trend + EFI Combined calculates QQE using smoothed RSI and Wilder's ATR, computes AK Trend values with dynamic scale factors matched to the chart timeframe using fast EMAs, and plots a scale-normalized EFI line. Main settings allow customization of RSI smoothing, QQE factors, timeframe scaling thresholds, and EFI normalization parameters.

Details

Published by

realanthonyc on GitHub

Code credit

Anthony, as written in the script's header

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Oscillators & momentum, Volume, Trend, Moving averages

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

indicatorpinescripttradingview

Settings

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

SettingTypeDefaultVariable
RSI Lengthint6rsiLengthPrimary
RSI Smoothingint5rsiSmoothingPrimary
QQE Factorfloat2.0qqeFactorPrimary
Thresholdfloat10.0thresholdPrimary
RSI SourcesourceclosesourcePrimary
ATR Length for QQE (Wilder)int14atrLen
Compute and Show AK Trend LinebooltrueshowAkTrend
Fast EMA 1int3input1
Fast EMA 2int8input2
AK Scale Factor (<15m)float28.0ak_scale_less_15m
AK Scale Factor (15m-1h)float16.0ak_scale_15m_1h
AK Scale Factor (>1h-1d)float8.0ak_scale_1h_1d
Show all 17 settings
SettingTypeDefaultVariable
AK Scale Factor (>1d)float3.0ak_scale_above_1d
EFI Lengthint13efiLength
Normalize EFIbooltruenormalizeEfi
EFI Normalize Lengthint200normalizeLength
EFI Target Amplitudefloat10.0targetAmplitude
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

RedK Volume-Accelerated Directional Energy Ratio (VADER) measures directional momentum accelerated by volume activity. It calculates price change relative to the average bar range, limits the ratio, and scales it using relative, raw, or static volume weighting

Indicator v5 VolumeOscillators & momentum
Updated 8 months ago · None stated GitHub repository of RedK Volume-Accelerated Directional Energy Ratio

BIST MTF Signal System

by Baran-Ozkann
1 stars

This indicator scores each bar of a BIST equity with a weighted confluence of thirteen layers and plots the result in a separate pane. Daily ADX, SMA and EMA alignment lock direction and can veto a candidate. The one-hour timeframe needs a PAC touch plus a con

Indicator v6 TrendOscillators & momentum Repaints
Updated 8 weeks ago · None stated GitHub repository of BIST MTF Signal System

Signal Strategy 15m

by tripolskypetr
72 stars

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem

Indicator v5 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Signal Strategy 15m
46 stars

This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of SuperTrend + MACD + EMA

Bte Acc

by f-cksociety
11 stars

Bte Acc is a chart indicator form of the PineCoders Backtesting and Trading Engine. It seeks an entry trigger from a main or alternate entry method, then checks trade direction, filters, date range, ATR readiness, and remaining capital before filling on the ne

Indicator v5 TrendOscillators & momentum Repaints
Updated 4 years ago · MPL-2.0 GitHub repository of Bte Acc

This indicator overlays a Hull Moving Average and three Exponential Moving Averages on the price chart while monitoring signals from MACD, Stochastic Oscillator, and Time Segmented Volume. It tracks trend direction changes, MACD histogram color shifts from bri

Indicator v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of MACD Signals with Alert System

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers