EMA deviations
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mnln

//@version=4
study("EMA deviations", overlay=true)
length = input(title="ema length", type=input.integer, defval=9)
ema = ema(close, length)
emaplus1 = ema * 1.01
emaplushalf = ema * 1.005

emaminus1 = ema * 0.99
emaminushalf = ema * 0.995

plot(ema, color=color.aqua)
plot(emaplus1, color=color.red)
plot(emaplushalf, color=color.gray)

plot(emaminus1, color=color.green)
plot(emaminushalf, color=color.gray)

