You are on page 1of 1

// This source code is subject to the terms of the Mozilla Public License 2.

0 at
https://mozilla.org/MPL/2.0/
//@version=4

study("EMA9+MA20+MA50", overlay=true)
//Selection box//
ema2 = input(title="EMA 9", type=input.bool, defval=true)
sma1 = input(title="SMA 20", type=input.bool, defval=true)
sma2 = input(title="SMA 50", type=input.bool, defval=true)
//sma3 = input(title="SMA 200", type=input.bool, defval=true)

//Parameters//
ema9 = ema(close, 9)
//ema10 = ema(close,10)
sma20 = sma(close,20)
sma50 = sma(close,50)
//sma200 = sma(close,200)

//Plotting lines//
plot(ema9 ? ema9 : na, title="EMA 9", color=#05b3fb, transp=0, linewidth=1)
plot(sma1 ? sma20 : na, title="SMA 20", color=#9c32a6, transp=0, linewidth=1)
plot(sma2 ? sma50 : na, title="SMA 50", color=#000000, transp=0, linewidth=1)
//plot(sma2 ? sma200 : na, title="SMA 200", color=#000000, transp=0, linewidth=2)

//Crossover Signal//
plotshape(crossover(ema9, sma20), style=shape.arrowup, color=#000000, text="BC1",
textcolor=#000000, location=location.belowbar, title="SHORT TERM BUY SIGNAL")
plotshape(crossover(sma20, sma50), style=shape.arrowup, color=#000000, text="BC2",
textcolor=#000000, location=location.belowbar, title="MID TERM BUY SIGNAL")
//plotshape(crossover(sma50, sma200), style=shape.arrowup, color=#dbff05,
text="Buy", textcolor=#000000, location=location.belowbar, title="LONG TERM BUY
SIGNAL")

plotshape(crossover(sma20,ema9), style=shape.arrowdown, color=#a63232, text="DC1",


textcolor=#a63232, location=location.abovebar, title="SHORT TERM BUY SIGNAL")
plotshape(crossover(sma50, sma20), style=shape.arrowdown, color=#a63232,
text="DC2", textcolor=#a63232, location=location.abovebar, title="MID TERM BUY
SIGNAL")
//plotshape(crossover(sma50, sma200), style=shape.arrowup, color=#dbff05,
text="Buy", textcolor=#000000, location=location.belowbar, title="LONG TERM BUY
SIGNAL")

You might also like