//@version=2 study(title = "MACD with LSME and triple EMA", shorttitle="LSMAMACD", overlay=false) length = input(title="LMSA1", type=integer, defval=14) len1 = input(title="EMA1", type=integer, defval=4) length2 = input(title="LMS21", type=integer, defval=14) len2 = input(title="EMA2", type=integer, defval=8) rr=input(title="RSI", type=integer, defval=14) src = input(close, title="Source") lsma1 = linreg(src, length, 0) lsma2 = linreg(src, length2, 0) r1 = rsi(ema(ema(ema(lsma1,len1),len1),len1),rr) r2 = rsi(ema(ema(ema(lsma2,len2),len2),len2),rr) plot(r1-50, color=red, linewidth=2) plot(r2-50, color=black, linewidth=2) plot(r1-r2, color = change(r2-r1) <= 0 ? lime : fuchsia, style=histogram, linewidth=4) hline(0)
Interesting. For those who don't see what is going on here. The source signal of the "LSMAMACD" is a linear regression with period 14 and then gb50k triple smoothes this source signal with EMA 4 / EMA 8 and then he calculates the RSI with period 14 of this triple smoothed linear regression, before he calculates the moving average of the faster smoothed version with EMA 4 minus the slower smoothed version with EMA 8.