Iconoclastic
New member
QQE modified by Iconoclastic 9.28.2021 http://tos.mx/37iIknw
Shared Study Link: http://tos.mx/37iIknw Click here for --> Easiest way to load shared links
- # QQE charts as Histogram
- # includes 5 period ADXmod with paint strategy
- # includes 8 period RSI with paint strategy
- # ADXmod & RSI8 paintstrategy adapted to bullish(ness) when greater than ZeroLine
- # Histogram Blue, RSI8 Green, and ADXmod LightBlue is strongest indicator / likelihood of increasing stock price
- # Minus10 line is there for entries with greater risk, ADXmod bounce or cross above -10
Shared Study Link: http://tos.mx/37iIknw Click here for --> Easiest way to load shared links
Ruby:
# QQE Indicator
# Converted by Kory Gill for BenTen at useThinkScript.com
# Original https://www.tradingview.com/script/zwbe2plA-Ghosty-s-Zero-Line-QQE/
# ****************************************
# Modified by Iconoclastic 9.28.2021
# QQE charts as Histogram
# includes 5 period ADXmod with paint strategy
# includes 8 period RSI with paint strategy
# ADXmod & RSI8 paintstrategy adapted to bullish(ness) when greater than ZeroLine
# Histogram Blue, RSI8 Green, and ADXmod LightBlue is strongest indicator / likelihood
# of increasing stock price
# Minus10 line is there for entries with greater risk, ADXmod bounce or cross above -10
declare lower;
input length = 5;
input price = HLC3;
input averageType = AverageType.WILDERS;
def ADX = DMI(length, averageType).ADX;
plot ADXmod = ADX - 40;
ADXmod.SetPaintingStrategy(PaintingStrategy.LINE);
ADXmod.SetLineWeight(4);
ADXmod.DefineColor("Up", CreateColor(128,212,255));
ADXmod.DefineColor("Down", Color.DARK_ORANGE);
ADXmod.AssignValueColor(
if ADXmod >= ADXmod[1] then ADXmod.Color("Up")
else ADXmod.Color("Down"));
# ********************
input RSIlength = 14;
input RSIprice = close;
input RSIaverageType = AverageType.WILDERS;
input showBreakoutSignals = no;
def NetChgAvg = MovingAverage(RSIaverageType, RSIprice - RSIprice[1], RSIlength);
def TotChgAvg = MovingAverage(RSIaverageType, AbsValue(RSIprice - RSIprice[1]), RSIlength);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI8 = (50 * (ChgRatio + 1))-40;
RSI8.SetPaintingStrategy(PaintingStrategy.LINE);
RSI8.SetLineWeight(3);
RSI8.DefineColor("Up", CreateColor(51,255,85));
RSI8.DefineColor("Down", Color.Gray);
RSI8.AssignValueColor(
if RSI8 >= 0 then RSI8.Color("Up")
else RSI8.Color("Down"));
# ********************
input RSI_Period = 8;
input Slow_Factor = 5;
input QQE = 4.236;
def Wilder_Period = RSI_Period * 2 - 1;
def vClose = close;
def rsi = RSI(price = vClose, length = RSI_Period).RSI;
def rsi_ma = MovingAverage(AverageType.EXPONENTIAL, rsi, Slow_Factor);
def atr_rsi = AbsValue(rsi_ma[1] - rsi_ma);
def atr_rsi_ma = MovingAverage(AverageType.EXPONENTIAL, atr_rsi, Wilder_Period);
def dar = MovingAverage(AverageType.EXPONENTIAL, atr_rsi_ma, Wilder_Period) * QQE;
def DeltaFastAtrRsi = dar;
def RSIndex = rsi_ma;
def newshortband = RSIndex + DeltaFastAtrRsi;
def newlongband = RSIndex - DeltaFastAtrRsi;
def longband = if RSIndex[1] > longband[1] and RSIndex > longband[1]
then max(longband[1],newlongband)
else newlongband;
def shortband = if RSIndex[1] < shortband[1] and RSIndex < shortband[1]
then min(shortband[1], newshortband)
else newshortband;
def trend = if Crosses(RSIndex, shortband[1])
then 1
else if Crosses(longband[1], RSIndex)
then -1
else if !IsNAN(trend[1])
then trend[1]
else 1;
def FastAtrRsiTL = if trend == 1
then longband
else shortband;
plot pFastAtrRsiTL = FastAtrRsiTL;
pFastAtrRsiTL.Hide();
plot pRsiMa = rsi_ma;
pRsiMa.Hide();
plot Minus10 = -10;
plot Zero = 0;
Minus10.SetDefaultColor(Color.Light_Gray);
Zero.SetDefaultColor(Color.Light_Gray);
plot Diff = rsi_ma - 50;
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(4);
#plot line50 = 50;
Diff.DefineColor("Long", CreateColor(25,102,255));
Diff.DefineColor("Short", Color.Light_red);
Diff.DefineColor("Wait", Color.Light_Gray);
def condition1 = pRsiMa > 50 and pRsiMa > FastAtrRsiTL;
def condition2 = pRsiMa < 50 and pRsiMa < FastAtrRsiTL;
Diff.AssignValueColor(if condition1==1 then
Diff.Color("Long")
else if condition2==1 then
Diff.Color("Short")
else Diff.Color("Wait"));
# end code
Last edited by a moderator: