Deewithme

Zero lag

Sep 22nd, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //@version=5
  2. indicator(title='ZLSMA Trend- Zero Lag SMA Trend', shorttitle='ZLSMA Trend', overlay=true, timeframe='')
  3. length = input(title='Length', defval=32)
  4. offset = input(title='Offset', defval=0)
  5. src = input(close, title='Source')
  6. lsma = ta.linreg(src, length, offset)
  7. lsma2 = ta.linreg(lsma, length, offset)
  8. eq = lsma - lsma2
  9. zlsma = lsma + eq
  10. zcolorchange = input(title='Change Color ?', defval=true)
  11. zColor = zcolorchange ? zlsma > zlsma[1] ? color.blue : color.red : color.yellow
  12. plot(zlsma, title='LagF', linewidth=4, color=zColor, transp=0)
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment