// Fixed error message "Index should not be negative(-8)"
// // Author lonestar108 // study(title = "3/9/27/9 Zero Lag EMA / EMA / Pivots / Dynamic Support", shorttitle="3/9/27/9 ZLEMA/EMA/Pivots/Support", overlay=true)
src=close lengths=input(3, title="Short Period Length") length=input(9, title="Fast Period Length") length2=input(27, title="Slow Period Length") plen=input(9, minval=1, title="Pivot Period Length")
// ema, zero lag ema ema1=ema(src, length) ema2=ema(ema1, length) d=ema1-ema2 zlema=ema1+d ema3=ema(src, length2)
// ema, zero lag ema ema4=ema(src, length) ema5=ema(ema4, length) d2=ema4-ema5 zlema2=ema4+d ema6=ema(src, length2)