Barcolor Superb
Barcolor Superb
// Input parameters
RSI_Period = input.int(14, title='RSI Length')
SF = input.int(14, title='RSI Smoothing')
QQE = input.float(4.618, title='Fast QQE Factor')
ThreshHold = input.float(3, title="Thresh-hold")
// Define MA function
ma(type, src, len) =>
switch type
"SMA" => ta.sma(src, len)
"EMA" => ta.ema(src, len)
"DEMA" =>
e = ta.ema(src, len)
2 * e - ta.ema(e, len)
"TEMA" =>
e = ta.ema(src, len)
3 * (e - ta.ema(e, len)) + ta.ema(ta.ema(e, len), len)
"WMA" => ta.wma(src, len)
"VWMA" => ta.vwma(src, len)
// Calculate QQE
src = close
Wilders_Period = RSI_Period * 2 - 1
Rsi = ta.rsi(src, RSI_Period)
RsiMa = ma("EMA", Rsi, SF)
AtrRsi = math.abs(RsiMa[1] - RsiMa)
MaAtrRsi = ma("EMA", AtrRsi, Wilders_Period)
dar = ma("EMA", MaAtrRsi, Wilders_Period) * QQE
DeltaFastAtrRsi = dar
RSIndex = RsiMa
newshortband = RSIndex + DeltaFastAtrRsi
newlongband = RSIndex - DeltaFastAtrRsi