OPEN-SOURCE SCRIPT

Renkli EMA_MA CROSS

42

indicator("Renkli MA Kesişimi + Oklar", overlay=true, precision=2

fastLen = input.int(20, "Hızlı MA (Fast)")
slowLen = input.int(50, "Yavaş MA (Slow)")
maType = input.string("EMA", "MA Tipi", options=["SMA", "EMA"])
showArrows = input.bool(true, "Okları Göster")

fastMA = maType == "EMA" ? ta.ema(close, fastLen) : ta.sma(close, fastLen)
slowMA = maType == "EMA" ? ta.ema(close, slowLen) : ta.sma(close, slowLen)

barcolor(fastMA > slowMA ? color.new(color.green, 0) : color.new(color.red, 0))

longSignal = ta.crossover(fastMA, slowMA)
shortSignal = ta.crossunder(fastMA, slowMA)

plotshape(showArrows and longSignal, title="Al", style=shape.labelup, location=location.belowbar, color=color.green, size=size.large, text="AL")
plotshape(showArrows and shortSignal, title="Sat", style=shape.labeldown, location=location.abovebar, color=color.red, size=size.large, text="SAT")

plot(fastMA, color=color.blue, title="Hızlı MA")
plot(slowMA, color=color.orange, title="Yavaş MA")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.