QQE ProRealTime indicator — or Quantitative Qualitative Estimation, is based on a rather complex calculation of the smoothed RSI indicators.
The QQE indicator consists of a smoothed Relative Strength Index (RSI) indicator and two volatility-based trailing levels (fast and slow). The Fast Trailing Level (TL) and Slow TL are constructed by calculating the ATR of the smoothed RSI over n-periods and then further smoothing the ATR using an additional n-periods Wilders smoothing function. This smoothed ATR of RSI is then multiplied by the Fast and Slow ATR Multipliers to calculate the final Fast and Slow Trailing Levels.
//PRC_QQE | indicator
//11.10.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//--- parameters
RSIPeriod = 14
SF = 5
QQE=4.236
//---
WildersPeriod = RSIPeriod * 2 - 1
if barindex>WildersPeriod then
MyRsi = rsi[RSIPeriod](close)
RsiMa = exponentialaverage[SF](MyRsi)
AtrRsi = abs(RsiMa[1] - RsiMa)
MaAtrRsi = exponentialaverage[WildersPeriod](AtrRsi)
dar = exponentialaverage[WildersPeriod](MaAtrRsi) * QQE
trr=TrLevelSlow[1]
dv = trr
if RsiMA[0]<trr then
trr = RsiMA[0] + dar
if(RsiMA[1]<dv) then
if(trr>dv) then
trr=dv
endif
endif
elsif RsiMA[0]>trr then
trr = RsiMA[0] - dar
if(RsiMA[1]>dv) then
if(trr<dv) then
trr=dv
endif
endif
endif
TrLevelSlow=trr
endif
RETURN trr coloured(0,0,0) as "QQE" , RsiMA coloured(0,0,200) as "RsiMA", 50 as "level 50"