//@version=4 study("QMP Filter Indicator", shorttitle="QMP", overlay=true, resolution ='') // MACD Programming // The MACD portion of this script was created by TradingView's RafaelZioni. The // script is titled "Zero Lag MACD Free". It is his/her work. I adapted it by // removing some inputs, removing some code that was not needed for my trading // style, and modified the colors. src10 = close smooth = 5 Length = 21 normalize(series) => h = highest(series, Length) l = lowest(series, Length) res = (series - l)/(h - l) len = 5 ma3 = wma(src10*volume, len) / wma(volume, len) result1 = normalize(ma3) m1 = sma(result1, smooth) m2 = sma(result1*100, smooth) plot(m2) source = close fastLength = 12 slowLength = 26 signalLength = 9 MacdEmaLength = 9 // Fast line ma1= ema(source, fastLength) ma2 = ema(ma1,fastLength) zerolagEMA = ((2 * ma1) - ma2) // Slow line mas1= ema(source , slowLength) mas2 = ema(mas1 , slowLength) zerolagslowMA = ((2 * mas1) - mas2) // MACD line blueMACD = zerolagEMA - zerolagslowMA // Signal line emasig1 = ema(blueMACD, signalLength) emasig2 = ema(emasig1, signalLength) orgMACD = (2 * emasig1) - emasig2 hist = blueMACD - orgMACD circleYPosition = orgMACD*1 dotColor = hist > 0 ? color.aqua : #ff0000 ///////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// // QQE Programming // This portion of the script was created by TradingView's greyghost7, called "Ghosty's Zero Line QQE". // Only edits made included some things like removing the inputs, and adapting colors to my liking. RSI_Period = 8 SF = 1 QQE = 2.618 Wilders_Period = RSI_Period * 2 - 1 Rsi = rsi(close,RSI_Period) blueLine = ema(Rsi, SF) AtrRsi = abs(blueLine[1] - blueLine) MaAtrRsi = ema(AtrRsi, Wilders_Period) dar = ema(MaAtrRsi,Wilders_Period) * QQE DeltaFastAtrRsi= dar RSIndex=blueLine newshortband= RSIndex + DeltaFastAtrRsi newlongband= RSIndex - DeltaFastAtrRsi longband=0.0, longband := RSIndex[1] > longband[1] and RSIndex > longband[1]? max(longband[1],newlongband):newlongband shortband=0.0, shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1]? min(shortband[1], newshortband):newshortband trend=0.0, trend := cross(RSIndex, shortband[1])?1:cross(longband[1], RSIndex)?-1:nz(trend[1],1) orangeLine = trend==1? longband: shortband ///////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// // Signals on price chart (Jim Brown's QMP Filter) longSituation = barssince(crossover(blueMACD,orgMACD)) < barssince(crossunder(blueMACD,orgMACD)) and blueLine > orangeLine shortSituation = barssince(crossover(blueMACD,orgMACD)) > barssince(crossunder(blueMACD,orgMACD)) and blueLine < orangeLine upSwitch = longSituation and barssince(longSituation)[1] > barssince(shortSituation)[1] and barstate.isconfirmed plotchar(upSwitch, char="●", color=#39ff14, size=size.tiny, transp=0, location=location.belowbar) downSwitch = shortSituation and barssince(shortSituation)[1] > barssince(longSituation)[1] and barstate.isconfirmed plotchar(downSwitch, char="●", color=#ff0000, size=size.tiny, transp=0, location=location.abovebar) ///////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////