Root mean squared error range (RMSER)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © spiritualhealer117

//@version=4
study("RMSE")
length = input(14, "Length")
src = input(title="Source", type=input.source, defval=close)


rmse = sqrt(sum(pow(sma(src, length)-src,2)/length,length))

top = sma(src + 2 * rmse,length)
bottom = sma(src -2 * rmse, length)

plot(top)
plot(bottom)

