Conversion code CVD pour ProRealTime

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #248897 quote
    Alai-n
    Participant
    Veteran

    Bonjour,

    Serait-il possible de convertir le code joint en langage ProBuilder pour ProRealTime.
    Je joins le lien original pour voir ce que devrait faire le code selon l’auteur!
    Merci

    https://fr.tradingview.com/script/GxBNW81a-Cumulative-Delta-TradingFinder-Volume-Periodic-EMA/

    // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © TFlab
    
    //@version=5
    indicator("Cumulative Delta [TradingFinder] Volume + Periodic + EMA" , "TFlab Cumulative Delta", overlay = false)
    
    CumMode = input.string('Total' , 'Cumulative Mode', ['Total' , 'Periodic' , 'EMA'])
    Period = input.int(21 , 'Period')
    UltraData = input.bool( false , '' , inline = 'Data')
    Market = input.string('Forex', 'Market Ultra Data', options = ['Forex', 'Crypto', 'Stock'], inline = 'Data')
    
    var string a = '' , var string b = '' , var string c = '' , var string d = '' , var string e = '' , var string f = '' , var string g = '' , var string h = ''
    var string i = '' , var string j = '' , var string k = '' , var string l = '' , var string m = '' , var string n = '' , var string o = '' , var string p = ''
    var string q = '' , var string r = '' , var string s = '' , var string t = '' , var string u = '' , var string v = '' , var string w = '' , var string x = ''
    var string y = '' , var string z = '' 
    
    
    switch Market 
        'Forex' =>  a := 'FX', b := 'OANDA' , c := 'FOREXCOM' , d := 'FX_IDC' , e := 'PEPPERSTONE' , f := 'CAPITALCOM' , g := 'ICMARKETS' , h := 'EIGHTCAP' , i := 'SAXO' , j := 'BLACKBULL' , k := 'VANTAGE' , l := 'FUSIONMARKETS' 
         , m := 'FPMARKETS' , n := 'GBEBROKERS' , o := 'IBKR' , p := 'ACTIVTRADES' , q := 'EASYMARKETS' , r := 'FXOPEN' , s := 'CITYINDEX' , t := 'AFTERPRIME' , u := 'SKILLING' , v := 'WHSELFINVEST' , w := 'TRADENATION'
         , x := 'THINKMARKETS' , y := 'CFI' , z := 'PHILLIPNOVA'
    
        'Crypto' =>  a := 'BITSTAMP', b := 'COINBASE' , c := 'INDEX' , d := 'CRYPTO' , e := 'BINANCE' , f := 'BITFINEX' , g := 'KRAKEN' , h := 'OANDA' , i := 'PEPPERSTONE' , j := 'GEMINI' , k := 'EIGHTCAP' , l := 'ICMARKETS' 
         , m := 'VANTAGE' , n := 'CAPITALCOM' , o := 'FOREXCOM' , p := 'FX' , q := 'BLACKBULL' , r := 'SAXO' , s := 'FUSIONMARKETS' , t := 'CRYPTOCOM' , u := 'EASYMARKETS' , v := 'OKCOIN' , w := 'FPMARKETS'
         , x := 'AFTERPRIME' , y := 'ACTIVTRADES' , z := 'BTSE'
    
        'Stock' =>  a := '-', b := '-' , c := '-' , d := '-' , e := '-' , f := '-' , g := '-' , h := '-' , i := '-' , j := '-' , k := '-' , l := '-' 
         , m := '-' , n := '-' , o := '-' , p := '-' , q := '-' , r := '-' , s := '-' , t := '-' , u := '-' , v := '-' , w := '-'
         , x := '-' , y := '-' , z := '-'
    
    
    V = nz(request.security(syminfo.tickerid, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Va = nz(request.security(a + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vb = nz(request.security(b + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vc = nz(request.security(c + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vd = nz(request.security(d + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Ve = nz(request.security(e + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vf = nz(request.security(f + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vg = nz(request.security(g + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vh = nz(request.security(h + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vi = nz(request.security(i + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vj = nz(request.security(j + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vk = nz(request.security(k + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vl = nz(request.security(l + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vm = nz(request.security(m + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vn = nz(request.security(n + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vo = nz(request.security(o + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vp = nz(request.security(p + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vq = nz(request.security(q + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vr = nz(request.security(r + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vs = nz(request.security(s + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vt = nz(request.security(t + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vu = nz(request.security(u + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vv = nz(request.security(v + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vw = nz(request.security(w + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vx = nz(request.security(x + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vy = nz(request.security(y + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    Vz = nz(request.security(z + ":" + syminfo.ticker, timeframe.period , volume, ignore_invalid_symbol = true)) 
    
    
    
    Vsum = V + Va + Vb + Vc + Vd + Ve + Vf + Vg + Vh + Vi + Vj + Vk + Vl + Vm + Vn + Vo + Vp + Vq + Vr + Vs + Vt + Vu + Vv + Vw + Vx + Vy + Vz
    
    Volume = if UltraData 
        Vsum
    else
        volume
    
    Buying = Volume *((close - low) / (high - low))
    Selling = Volume * ((high - close) / (high - low))
    
    delta = Buying - Selling
    
    Cumulative = if CumMode == "Total" 
        ta.cum(delta)
    else if CumMode == "Periodic"
        math.sum(delta , Period)
    else if CumMode == "EMA"
        ta.ema(delta , Period)  
    
    
    
    plotcandle(Cumulative[1], Cumulative,Cumulative[1], Cumulative, color = Cumulative - Cumulative[1] >= 0 ? color.green : color.red, bordercolor = Cumulative - Cumulative[1] >= 0 ? color.green : color.red)
    
    #248898 quote
    Iván González
    Moderator
    Master
    //-----------------------------------------//
    //PRC_Cumulative Delta Volume (TFLab)
    //version = 0
    //16.07.2025
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-----------------------------------------//
    // --- Inputs
    //-----------------------------------------//
    CumMode=1
    Period=21
    //-----------------------------------------//
    // --- Calculation: Delta Volume
    //-----------------------------------------//
    if (high-low) <>0 then
       buying=volume*((close-low)/(high-low))
       selling=volume*((high-close)/(high-low))
    endif
    
    delta=buying-selling
    //-----------------------------------------//
    // --- Calculation: Cumulative Delta Volume
    //-----------------------------------------//
    if CumMode=1 then
       cumulative=cumsum(delta)
    elsif CumMode=2 then
       cumulative=summation[period](delta)
    else
       cumulative=average[period,1](delta)
    endif
    //-----------------------------------------//
    // --- Plot Candles & colors
    //-----------------------------------------//
    if cumulative>cumulative[1] then
       r=0
       g=255
       b=0
    else
       r=255
       g=0
       b=0
    endif
    
    drawcandle(cumulative[1],cumulative[1],cumulative,cumulative)coloured(r,g,b)
    //-----------------------------------------//
    return
    
    Alai-n thanked this post
    #248899 quote
    Alai-n
    Participant
    Veteran

    Je pensais qu’il y avait un repérage visuel sur l’indicateur pour visualiser les absorptions et les épuisements. Mais ce n’est visiblement pas le cas!
    Iván merci pour la conversion.

    #248903 quote
    larouedegann
    Participant
    Master

    Le problème de ce genre d’indicateur c’est qu’il sera toujours passif. Bougie verte on additionne les volumes, bougie rouge on soustrait les volumes.

    Tant que le cumulative delta ne sera pas basé sur le “time and sale”  c’est à dire sur le vrais volumes échangés , l’indicateur ne sera pas exact.

    Alai-n thanked this post
    #248907 quote
    Alai-n
    Participant
    Veteran

    Certaines configurations d’Absorptions et d’Epuisements ont tout de même le mérite d’être mise en évidence par cet indicateur. Pour avoir utilisé le Bookmap, j’ai pu faire un comparatif entre le CumDelta que l’on trouve ici et celui de Bookmap. Ils sont quand même très similaire tout du moins dans les horizons que j’ai testé.
    Le Cumulative Delta que Nicolas a mis à disposition il y a déjà de nombreux mois est selon moi bien meilleur que celui sur cette page! Au départ je pensais qu’il était associé à une représentation graphique pour repérer les absorptions et les épuisements, mais j’ai fait erreur…

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Conversion code CVD pour ProRealTime


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Alai-n @alai-n Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Alai-n
7 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/16/2025
Status: Active
Attachments: No files
Logo Logo
Loading...