Trendilo LSMA Band Example
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dudeowns

//@version=5
indicator("Trendilo LSMA",overlay = true)
length = input(title="LSMAlen", defval=25)
offset2 = input(title="LSMA Offset", defval=0)
smooth = input(title = "LSMA Smoother", defval = 5)
src = ta.ema(hl2, smooth)
lsma = ta.linreg(src, length, offset2)

length2 = input(title = "HMAlen", defval = 50)
hma = ta.hma(src, length2)

combine = math.avg(lsma, hma)

signal = combine - combine[1]
colorr = signal > 0 ? color.rgb(0, 255, 10) : signal < 0 ? color.rgb(254, 24, 7) : color.yellow

plot(combine, color = colorr, linewidth = 2)
