Root Mean Square (RMS)
// 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("RMS", overlay = true)
rms(source, length)=>
    math.sqrt(math.sum(math.pow(source, 2), length)/length)
source = input.source(close, "Source")
length = input.int(20, "Length", 1)
plot(rms(source, length))
