OPEN-SOURCE SCRIPT

EMA COLOR BUY SELL

41

indicator("EMA Tabanlı Renkli İndikatör", overlay=true)

emaLength = input.int(21, "EMA Periyodu")
fastEMA = ta.ema(close, emaLength)
slowEMA = ta.ema(close, emaLength * 2)

trendUp = fastEMA > slowEMA
trendDown = fastEMA < slowEMA

barcolor(trendUp ? color.new(color.green, 0) : trendDown ? color.new(color.red, 0) : color.gray)

plot(fastEMA, color=trendUp ? color.green : color.red, title="Fast EMA", linewidth=2)
plot(slowEMA, color=color.blue, title="Slow EMA", linewidth=2)

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.