EMA by DHIREN BHAGOJI
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EMA by DHIREN BHAGOJI
//@version=4

study(title="EMA by DHIREN BHAGOJI", shorttitle="EMA by DHIREN BHAGOJI", overlay=true) 
showEMA20       = input(title="Show EMA-20", type=input.bool, defval=false)
showEMA50       = input(title="Show EMA-50", type=input.bool, defval=false)
showEMA200      = input(title="Show EMA-200", type=input.bool, defval=false)

/// EMA Code ///
EMA20_Len       = input(20, minval=1, title="EMA20_Length")
EMA20_out       = ema(close, EMA20_Len)
plot(showEMA20 ? EMA20_out:na, title="EMA - 20", color=color.red, offset=0, linewidth=1)

EMA50_Len       = input(50, minval=1, title="EMA50_Length")
EMA50_out       = ema(close, EMA50_Len)
plot(showEMA50 ? EMA50_out:na, title="EMA - 50", color=color.blue, offset=0, linewidth=2)

EMA200_Len       = input(200, minval=1, title="EMA200_Length")
EMA200_out       = ema(close, EMA200_Len)
plot(showEMA200 ? EMA200_out:na, title="EMA - 200", color=color.black, offset=0, linewidth=3)