Untitled

 avatar
unknown
plain_text
2 months ago
1.8 kB
2
Indexable
//@version=6
indicator('Kadri Al Sat Alarm', overlay = true)

// Kullanıcı giriş parametreleri
emaLength1 = input.int(8, title = 'EMA 1 Uzunluğu')
emaLength2 = input.int(14, title = 'EMA 2 Uzunluğu')
emaTimeframe = input.timeframe('W', title = 'EMA Zaman Dilimi')
entryPrice = input.float(0.0, title = 'Giriş Fiyatı')
exitPrice1 = input.float(0.0, title = 'Çıkış Fiyatı 1 (0.880)')
exitPrice2 = input.float(0.0, title = 'Çıkış Fiyatı 2 (1.236)')
stopLossPercent = input.float(2.0, title = 'Stop Loss (%)')

// EMA hesaplamaları
ema1 = request.security(syminfo.tickerid, emaTimeframe, ta.ema(close, emaLength1))
ema2 = request.security(syminfo.tickerid, emaTimeframe, ta.ema(close, emaLength2))

// Stop Loss hesaplama
stopLossLevel = entryPrice * (1 - stopLossPercent / 100)

// Basit çizgiler - her zaman görünür
p1 = plot(entryPrice > 0 ? entryPrice : na, 'Giriş Fiyatı', color = #1b12ce, linewidth = 2)
p2 = plot(entryPrice > 0 ? stopLossLevel : na, 'Stop Loss', color = color.red, linewidth = 2)
p3 = plot(exitPrice1 > 0 ? exitPrice1 : na, 'Çıkış Fiyatı 1', color = #028be7, linewidth = 2)
p4 = plot(exitPrice2 > 0 ? exitPrice2 : na, 'Çıkış Fiyatı 2', color = #02e747, linewidth = 2)

// EMA çizgileri
plot(ema1, 'EMA 8', color = color.green, linewidth = 1)
plot(ema2, 'EMA 14', color = color.orange, linewidth = 1)

// Uyarılar
if close >= exitPrice1 and exitPrice1 > 0
    alert('İlk Satış Rakamına Geldi (0.880): ' + str.tostring(exitPrice1))

if close >= exitPrice2 and exitPrice2 > 0
    alert('İkinci Satış Rakamına Geldi (1.236): ' + str.tostring(exitPrice2))

if close <= stopLossLevel and entryPrice > 0
    alert('Stop Loss seviyesine ulaşıldı: ' + str.tostring(stopLossLevel))
Leave a Comment