Untitled

mail@pastecode.io avatar
unknown
plain_text
11 days ago
3.7 kB
2
Indexable
Never
//@version=4
study("finito inşallah v2", shorttitle="finito inşallah v2", overlay=true)

// Kullanıcı girişi
downTrendNumberColor = input(title="Düşüş Trendli Sayı Rengi", defval=color.red, type=input.color)
specialDownTrendNumberColor = input(title="Özel Düşüş Trendli Sayı Rengi (3, 6, 9)", defval=color.purple, type=input.color)
extraNumberColor = input(title="Ekstra Rakam Rengi", defval=color.red, type=input.color)
skipMumColor = input(title="Atlanan Mum İşareti Rengi", defval=color.gray, type=input.color)
startDate = input(title="Başlangıç Tarihi", type=input.time, defval=timestamp("2024-01-01T00:00:00+00:00"))
endDate = input(title="Bitiş Tarihi", type=input.time, defval=timestamp("2024-12-31T23:59:59+00:00"))
startCount = input(title="Başlangıç Sayısı", type=input.integer, defval=1, minval=1, maxval=2)

// Tarih aralığı kontrolü
inDateRange = time >= startDate and time <= endDate

// Değişkenler
var float lastNumberedHighD = na
var float lastNumberedLowD = na
var int barIndexD = na
var int barCountD = na
var float firstBarHighD = na
var float firstBarLowD = na

// İlk mum için ayarlar
if (na(barCountD) and inDateRange)
    barCountD := startCount
    firstBarHighD := high
    firstBarLowD := low
    lastNumberedHighD := high
    lastNumberedLowD := low
    barIndexD := bar_index
    label.new(bar_index, high, text=tostring(barCountD), style=label.style_none, color=color.new((barCountD==3 or barCountD==6 or barCountD==9 ? specialDownTrendNumberColor : downTrendNumberColor), 100), yloc=yloc.abovebar, textcolor=(barCountD==3 or barCountD==6 or barCountD==9 ? specialDownTrendNumberColor : downTrendNumberColor))

// Düşüş trendli sayım için mum sayımı
if (bar_index > barIndexD and inDateRange)
    if (low < firstBarLowD)
        nextCount = barCountD + (((high - close) > (open - low)) ? 2 : 1)
        if (nextCount > 9)
            nextCount := startCount == 2 ? 2 : 1
        
        skipBar = high > lastNumberedHighD and low < lastNumberedLowD and nextCount != 3 and nextCount != 6 and nextCount != 9
        
        if (not skipBar)
            firstBarHighD := high
            firstBarLowD := low
            lastNumberedHighD := high
            lastNumberedLowD := low
            barIndexD := bar_index
            barCountD := nextCount
            
            label.new(bar_index, high, text=tostring(barCountD), style=label.style_none, color=color.new((barCountD==3 or barCountD==6 or barCountD==9 ? specialDownTrendNumberColor : downTrendNumberColor), 100), yloc=yloc.abovebar, textcolor=(barCountD==3 or barCountD==6 or barCountD==9 ? specialDownTrendNumberColor : downTrendNumberColor))
            
            if ((barCountD == 1 or barCountD == 4 or barCountD == 7) and ((high - close) > (open - low)))
                extraNumber = barCountD == 1 ? 9 : barCountD == 4 ? 3 : 6
                label.new(bar_index, low, text=tostring(extraNumber), style=label.style_none, color=extraNumberColor, yloc=yloc.belowbar, textcolor=extraNumberColor)
            else if ((barCountD == 2 or barCountD == 5 or barCountD == 8) and ((high - close) <= (open - low)))
                extraNumber = barCountD == 2 ? 3 : barCountD == 5 ? 6 : 9
                label.new(bar_index, low, text=tostring(extraNumber), style=label.style_none, color=extraNumberColor, yloc=yloc.belowbar, textcolor=extraNumberColor)
        else
            // Atlanan mumları göster
            label.new(bar_index, high, text="X", style=label.style_none, color=color.new(skipMumColor, 50), yloc=yloc.abovebar, textcolor=skipMumColor)
Leave a Comment