Untitled

 avatar
unknown
plain_text
5 months ago
1.1 kB
39
Indexable
//@version=5
indicator("Hisse/XU100 Oranı ve EMA", overlay=false)

// Input parametreleri
ema1_length = input(10, title="EMA 1 Periyodu")
ema2_length = input(20, title="EMA 2 Periyodu")
ema3_length = input(50, title="EMA 3 Periyodu")
ema4_length = input(100, title="EMA 4 Periyodu")
ema5_length = input(200, title="EMA 5 Periyodu")

// Sembolleri tanımla
xu100 = request.security("BIST:XU100", timeframe.period, close)
hisse = close

// Hisse/XU100 oranını hesapla
X = hisse / xu100

// Son XU100 değeriyle çarp
sonuc = X * xu100

// EMA hesaplamaları
ema1 = ta.ema(sonuc, ema1_length)
ema2 = ta.ema(sonuc, ema2_length)
ema3 = ta.ema(sonuc, ema3_length)
ema4 = ta.ema(sonuc, ema4_length)
ema5 = ta.ema(sonuc, ema5_length)

// Ana değerleri plot et
plot(sonuc, title="Sonuç", color=color.blue, linewidth=2)
plot(X, title="Oran", color=color.green)

// EMA'ları plot et
plot(ema1, title="EMA 1", color=color.red)
plot(ema2, title="EMA 2", color=color.yellow)
plot(ema3, title="EMA 3", color=color.purple)
plot(ema4, title="EMA 4", color=color.orange)
plot(ema5, title="EMA 5", color=color.white)
Editor is loading...
Leave a Comment