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

//@version=4
study("Swing EMA",overlay=true)
// Input
sema50 = input(50,title="50 EMA")
sema20 = input(20,title="20 EMA")
srema100 = input(100,title="100 EMA")
srema200 = input(200,title="200 EMA")

// EMA Used
EMA20 = ema(close, sema20)
EMA50 = ema(close, sema50)
SREMA100 = ema(close, srema100)
SREMA200 = ema(close, srema200)

// Color condition's
col52 = iff(EMA20>=EMA50,color.lime,color.red)
col3 = iff(SREMA100>=SREMA200, color.lime,color.red)

// Main MA Polting
MA52 = plot(series=EMA20,color=col52, linewidth=2)
MA21 = plot(series=SREMA100,color=col3, linewidth=2)
MA12 = plot(series=SREMA200,color=col3, linewidth=3)

// giving fill to plot
fill(MA21,MA12,color = SREMA100>=SREMA200 ? color.green : color.red)
