Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- indicator(title='ZLSMA Trend- Zero Lag SMA Trend', shorttitle='ZLSMA Trend', overlay=true, timeframe='')
- length = input(title='Length', defval=32)
- offset = input(title='Offset', defval=0)
- src = input(close, title='Source')
- lsma = ta.linreg(src, length, offset)
- lsma2 = ta.linreg(lsma, length, offset)
- eq = lsma - lsma2
- zlsma = lsma + eq
- zcolorchange = input(title='Change Color ?', defval=true)
- zColor = zcolorchange ? zlsma > zlsma[1] ? color.blue : color.red : color.yellow
- plot(zlsma, title='LagF', linewidth=4, color=zColor, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment