Stochastic Moving Average Delta Oscillator (SMADO)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © peacefulLizard50262

//@version=5
indicator("SMADO")
back   = input.int(25, "Window", 1)
len    = input.int(200, "Length", 1)
smooth = input.int(4, "Smoothing", 1)
lag    = input.int(10, 'Lag Line', 1)

del = array.new<float>(len)
for i = 1 to len by 1
    array.push(del, ta.cum(ta.sma(close, i) - ta.sma(close, i)[1]))

delta_sum = ta.sma(array.sum(del), smooth) 
scale  = ta.stoch(delta_sum, delta_sum, delta_sum, back)

mom       = ta.sma(scale, lag)

colour = scale >= mom ? color.new(color.blue, 10) : color.new(color.orange, 10)

u = plot(scale, color = colour)
d = plot(mom, color = colour)
fill(u, d, color = colour)