Traduzione codice TW Dvd

Forums ProRealTime forum Italiano Supporto ProBuilder Traduzione codice TW Dvd

Viewing 1 post (of 1 total)
  • #248702

    Buongiorno,

    chiedo cortese traduzione codice in oggetto che vorrei testare.

    Grazie per l’aiuto.

    https://it.tradingview.com/script/2e7GfTx8-Dual-Volume-Divergence-Line/

    // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // Dual Volume Divergence Index [DW] oscillator is utilized and get inspired by.
    // Original concept by DonovanWall
    // Modified by © keremertem
    //@version=6
    indicator(‘Dual Volume Divergence Line’, shorttitle = ‘DVD/Line’, overlay = true)
    import TradingView/ta/9

    //—————————————————————————–\\
    // — Ayarlar
    //—————————————————————————–//
    zaman = input.int(17, ‘Dvd Sampling Period’, 2, 100)
    genislik = input.int(12, ‘Band Width’, 2, 50)
    takip = input.int(3, ‘Trailing Length’, 2, 20)
    kaynak = input.source(hlc3, ‘Source’)
    carpan = input.float(1, ‘Multiplier’, 0.5, 10, 0.5)
    //— SON —

    //—————————————————————————–\\
    // — DVD Gostergesi
    //—————————————————————————–//
    hacim = volume

    // Pozitif Hacim Endeksi (PVI) Hesaplama
    var float pvi = 0.0
    pvi := kaynak > kaynak[1] ? pvi + (kaynak – kaynak[1]) : pvi

    // PVI Sinyali ve Iraksama
    pvi_sinyal = ta.wma(pvi, zaman) // EMA fonksiyonu yerine WMA geldi
    pvi_iraksama = (pvi – pvi_sinyal)

    // Negatif Hacim Endeksi (NVI) Hesaplama
    var float nvi = 0.0
    nvi := kaynak < kaynak[1] ? nvi – (kaynak – kaynak[1]) : nvi

    // NVI Sinyali ve Iraksama
    nvi_sinyal = ta.wma(nvi, zaman) // EMA fonksiyonu yerine WMA geldi
    nvi_iraksama = (nvi – nvi_sinyal)

    // DVD Hesaplama
    Dvdi = (pvi_iraksama – nvi_iraksama) * carpan
    Dvd = ta.wma(Dvdi + kaynak, genislik) // EMA fonksiyonu yerine WMA geldi
    Dvd2 = ta.linreg(Dvd, takip, 1) // Takip cizgisi
    Max = ta.highest(Dvd, genislik)
    Min = ta.lowest(Dvd, genislik)
    Ust = ta.rms(Max, genislik)
    Alt = ta.rms(Min, genislik)
    Orta = (Alt + Ust)/2
    Ust := 2 * Ust – Orta
    Alt := 2 * Alt – Orta

    // Cizim
    rnk = Dvd > Dvd2 ? #00e6de : #fb00ff
    ciz1 = plot(Dvd, ‘DVD Line’, rnk, 3)
    gosterBand = input.bool(false, ‘Show Bands’)
    ciz2 = plot(Ust, ‘Upper Band’, #ff525280, 2, plot.style_cross, display = gosterBand ? display.all : display.none)
    ciz3 = plot(Alt, ‘Lower Band’, #00e67780, 2, plot.style_cross, display = gosterBand ? display.all : display.none)
    ornk = Orta > Orta[1] ? #00e67780 : #ff525280
    ciz4 = plot(Orta, ‘Middle Band’, ornk, 3)
    //— SON —

    //—————————————————————————–\\
    // — Iraksama Gostergesi Secimi
    //—————————————————————————–//
    string N_type = input.string(‘DVDI’, title = ‘Divergence Selection’, options=[‘DVDI’, ‘DVD Line’], group = ‘Divergence’)

    Ir_Go(type) =>
    switch type
    ‘DVDI’ => Dvdi
    ‘DVD Line’ => Dvd
    //— SON —

    //—————————————————————————–\\
    // — Iraksama Saptama
    //—————————————————————————–//
    IrGo = Ir_Go(N_type)

    // Pivot Noktalari Saptama
    Ir = input.int(1, ‘Divergence Range’)
    py = na(ta.pivothigh(IrGo, Ir, Ir)) ? false : true
    pd = na(ta.pivotlow(IrGo, Ir, Ir)) ? false : true
    pyFiyat = ta.valuewhen(py, high[Ir], 1)
    pdFiyat = ta.valuewhen(pd, low[Ir], 1)
    pyIrGo = ta.valuewhen(py, IrGo[Ir], 1)
    pdIrGo = ta.valuewhen(pd, IrGo[Ir], 1)

    // Boga Iraksama (Normal & Gizli)
    bogaNormal = pd and IrGo[Ir] > pdIrGo and low[Ir] < pdFiyat
    bogaGizli = pd and IrGo[Ir] < pdIrGo and low[Ir] > pdFiyat

    // Ayı Iraksama (Normal & Gizli)
    ayiNormal = py and IrGo[Ir] < pyIrGo and high[Ir] > pyFiyat
    ayiGizli = py and IrGo[Ir] > pyIrGo and high[Ir] < pyFiyat

    // Etiketleme
    gosterNormal = input.bool(true, ‘Show Normal Divergences’)
    gosterGizli = input.bool(false, ‘Show Hidden Divergences’)
    if gosterNormal and bogaNormal
    label.new(x=bar_index – Ir, y=low[Ir], text=’Bull’, color=color.green, style=label.style_label_up, textcolor=color.white, size=size.small)
    if gosterGizli and bogaGizli
    label.new(x=bar_index – Ir, y=low[Ir], text=’hid.’, color=color.lime, style=label.style_label_up, textcolor=color.white, size=size.small)
    if gosterNormal and ayiNormal
    label.new(x=bar_index – Ir, y=high[Ir], text=’Bear’, color=color.red, style=label.style_label_down, textcolor=color.white, size=size.small)
    if gosterGizli and ayiGizli
    label.new(x=bar_index – Ir, y=high[Ir], text=’hid.’, color=color.orange, style=label.style_label_down, textcolor=color.white, size=size.small)
    //— SON —

Viewing 1 post (of 1 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login