//version=5
indicator("Moving Average Cross", overlay=true)

// Ayarlar
short_length = input.int(9, title="Short Moving Average Length")
long_length = input.int(21, title="Long Moving Average Length")

// Hareketli Ortalamalar
short_ma = ta.sma(close, short_length)
long_ma = ta.sma(close, long_length)

// Kesişimler
buy_signal = ta.crossover(short_ma, long_ma)
sell_signal = ta.crossunder(short_ma, long_ma)

// Sinyalleri Göster
plot(short_ma, color=color.blue, title="Short MA")
plot(long_ma, color=color.red, title="Long MA")

// Sinyalleri İşaretle
plotshape(series=buy_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=sell_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")

// İşlem Stratejisi
strategy.entry("Buy", strategy.long, when=buy_signal)
strategy.close("Buy", when=sell_signal)
Trend Analysis

Feragatname