OPEN-SOURCE SCRIPT

EMA Cross BUY SELL

83



ema1Length = input.int(10, "EMA1 Periyodu")
ema2Length = input.int(20, "EMA2 Periyodu")
emaLineWidth = input.int(3, "EMA Çizgi Kalınlığı", minval=1, maxval=10)
bgTransparency = input.int(85, "Arka Plan Saydamlığı", minval=0, maxval=100)


ema1 = ta.ema(close, ema1Length)
ema2 = ta.ema(close, ema2Length)


longSignal = ta.crossover(ema1, ema2)
shortSignal = ta.crossunder(ema1, ema2)


var int trend = 0
trend := longSignal ? 1 : shortSignal ? -1 : trend


barcolor(trend == 1 ? color.green : trend == -1 ? color.red : na)


bgcolor(trend == 1 ? color.new(color.green, bgTransparency) : trend == -1 ? color.new(color.red, bgTransparency) : na)
plot(ema1, color=trend == 1 ? color.green : trend == -1 ? color.red : color.gray, linewidth=emaLineWidth, title="EMA1")
plot(ema2, color=trend == 1 ? color.green : trend == -1 ? color.red : color.gray, linewidth=emaLineWidth, title="EMA2")

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

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.