OPEN-SOURCE SCRIPT

EMA Color Cross + Trend Bars

32
//version=5
indicator("EMA Color Cross + Trend Bars", overlay=true)

// EMA ayarları
shortEMA = input.int(9, "Short EMA")
longEMA = input.int(21, "Long EMA")

emaShort = ta.ema(close, shortEMA)
emaLong = ta.ema(close, longEMA)

// Trend yönü
trendUp = emaShort > emaLong
trendDown = emaShort < emaLong

// EMA çizgileri trend yönüne göre renk değiştirsin
plot(emaShort, color=trendUp ? color.green : color.red, linewidth=2)
plot(emaLong, color=trendUp ? color.green : color.red, linewidth=2)

// Barları trend yönüne göre renklendir
barcolor(trendUp ? color.green : color.red)

// Kesişim sinyalleri ve oklar
longSignal = ta.crossover(emaShort, emaLong)
shortSignal = ta.crossunder(emaShort, emaLong)

plotshape(longSignal, title="Long", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.large)
plotshape(shortSignal, title="Short", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.large)

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.