# MACD with LSME and triple EMA

255 4
MACD - with each MA defined as follows:

ema ( ema ( ema ( LSMA ( src             ,len1),len2),len2)len2)
```//@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.
neat
Whaaaatttt the fffff... Gotta explain this to simpleton mindZ like mine...

Because if you do, I'll program it in C# and you can use that for algorithm trading for yourself ;)
a nice work!
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
ประเทศไทย
Việt Nam

한국

Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter