Conversion of Dynamic Flow Ribbons and of Deviation Trend Profile of Tradingview

Forums ProRealTime forum Français Support ProBuilder Conversion of Dynamic Flow Ribbons and of Deviation Trend Profile of Tradingview

  • This topic has 0 replies, 1 voice, and was last updated 6 hours ago by avatarnpam.
Viewing 1 post (of 1 total)
  • #248652

    Bonjour,
    J’ai trouvé deux excellents indicateurs sur TradingView. J’ai du mal à le traduire. Si vous ne pouvez en traduire seulement un seul, ca me va.
    Ce sont les Dynamic Flow Ribbons et le Deviation Trend Profile. Les 2 viennent de BigBeluga, je vois mets le code ci dessous
    Quelqu’un peut-il m’aider ?
    Merci d’avance
    Cordialement

    Hello,
    I have found 2 such great indicators on TradingView. I got difficulties to translate it. If you can only translate one of them, it is okay, better one than nothing
    It is the Dynamic Flow Ribbons and the Deviation Trend Profile, both of BigBeluga, i will let you the code below.
    Can someone help me ?
    Thanks

    Kinds Regards

    // This work is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
    // https://creativecommons.org/licenses/by-nc-sa/4.0/
    // © BigBeluga
    //@version=6
    indicator(“Deviation Trend Profile [BigBeluga]”, overlay = true, max_boxes_count = 500, max_bars_back = 5000)
    // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
    grp = “Standart Deviation Levels”
    length = input.int(50, “SMA Length”, group = “SMA”)
    mult1 = input.int(1, “Standart Deviation 1”, group = grp)
    mult2 = input.int(2, “Standart Deviation 2”, group = grp)
    mult3 = input.int(3, “Standart Deviation 3”, group = grp)
    show_tp = input.bool(true, “Show”, group = “Trend Distribution Profile”)
    bins = input.int(50, “Bins Amount”, group = “Trend Distribution Profile”)
    offset = input.int(30, “Offset”, group = “Trend Distribution Profile”)
    col_up = input.color(color.rgb(18, 209, 235), “”, group = “Theme”, inline = “c”)
    col_dn = input.color(color.rgb(250, 40, 86), “”, group = “Theme”, inline = “c”)
    var start_index = int(na)
    var trend = bool(na)
    // }
    // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
    avg = ta.sma(close, length)
    atr = ta.atr(200)
    stdv1 = avg + atr * mult1
    stdv2 = avg + atr * mult2
    stdv3 = avg + atr * mult3
    stdv_1 = avg – atr * mult1
    stdv_2 = avg – atr * mult2
    stdv_3 = avg – atr * mult3
    max = stdv3
    min = stdv_3
    avg_diff = avg – avg[5]
    avg_col = avg_diff / ta.percentile_linear_interpolation(avg_diff, 500, 100)
    avg_color = color.from_gradient(avg_col, -0.3, 0.3, col_dn, col_up)
    if ta.crossover(avg_col, 0.1) and not trend
    trend := true
    start_index := bar_index
    if ta.crossunder(avg_col, -0.1) and trend
    trend := false
    start_index := bar_index
    loockback = bar_index – start_index
    profile(min, max)=>
    var boxes = array.new()
    var bin = array.new(bins)
    step = (max – min) / bins
    start = bar_index + offset
    if barstate.islast
    if boxes.size() >=0
    for b in boxes
    box.delete(b)
    for g = 0 to bins-1
    bin.set(g, 0)
    for l = 0 to loockback
    c = close[l]
    a = avg[l]
    mi = min[l]
    s = step[l]
    for i = 0 to bin.size()-1
    lower = mi + s * i
    upper = lower + s
    if c >= lower-s and c <= upper+s bin.set(i, bin.get(i) + 1) for j = 0 to bin.size()-1 val = bin.get(j) lower = min + step * j upper = lower + step col = color.from_gradient(val, 0, bin.max(), color.new(chart.fg_color, 80), avg_color) boxes.push(box.new(start-val, upper, start, lower, bgcolor = col, border_color = val == 0 ? chart.fg_color : chart.bg_color)) label.delete(label.new(start, max, str.tostring(loockback), textcolor = chart.fg_color, color = color.new(avg_color, 80), tooltip = str.tostring(loockback) + " bars back beginnig of the trend")[1]) draw_stdv(src, mult, mid = false)=>
    if barstate.islast
    if mid
    line.delete(line.new(bar_index, avg, bar_index+5, avg, color = avg_color, width = 2)[1])
    line.delete(line.new(bar_index, src, bar_index+5, src, color = chart.fg_color, width = 2)[1])
    label.delete(label.new(bar_index+5, src, color = color.new(chart.fg_color, 100), textcolor = chart.fg_color, text = mult, style = label.style_label_left)[1])
    // }
    // PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
    draw_stdv(stdv1, “+1”, true)
    draw_stdv(stdv2, “+2”)
    draw_stdv(stdv3, “+3”)
    draw_stdv(stdv_1, “-1”)
    draw_stdv(stdv_2, “-2”)
    draw_stdv(stdv_3, “-3”)
    if show_tp
    profile(min, max)
    plot(avg, color = avg_color, linewidth = 3)
    plotshape(trend != trend[1] and trend ? avg : na, “Up”, shape.circle, location.absolute, size = size.tiny, color = col_up)
    plotshape(trend != trend[1] and trend ? avg : na, “Up”, shape.circle, location.absolute, size = size.small, color = color.new(col_up, 50))
    plotshape(trend != trend[1] and not trend ? avg : na, “Down”, shape.circle, location.absolute, size = size.tiny, color = col_dn)
    plotshape(trend != trend[1] and not trend ? avg : na, “Down”, shape.circle, location.absolute, size = size.small, color = color.new(col_dn, 50))
    // }

    // This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © BigBeluga

    //@version=6
    indicator(“Dynamic Flow Ribbons [BigBeluga]”, overlay = true)

    // INPUTS ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{

    factor = input.float(3, “Length”, step = 0.01)

    col_up = input.color(color.rgb(26, 221, 127), “”, inline = “Col”)
    col_dn = input.color(color.rgb(231, 147, 20), “”, inline = “Col”)
    // }

    // CALCULATIONS――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{
    float dist = ta.sma(high-low, 200)

    trend_line(factor)=>

    float src = hlc3
    int _direction = na
    float trend_line = na

    upperBand = ta.ema(src, 15) + factor * dist
    lowerBand = ta.ema(src, 15) – factor * dist
    prevLowerBand = nz(lowerBand[1])
    prevUpperBand = nz(upperBand[1])

    lowerBand := lowerBand > prevLowerBand or src[1] < prevLowerBand ? lowerBand : prevLowerBand upperBand := upperBand < prevUpperBand or src[1] > prevUpperBand ? upperBand : prevUpperBand

    prevTrendLine = trend_line[1]
    if na(dist[1])
    _direction := 1
    else if prevTrendLine == prevUpperBand
    _direction := src > upperBand ? -1 : 1
    else
    _direction := src < lowerBand ? 1 : -1 trend_line := _direction == -1 ? lowerBand : upperBand line_ = math.avg(lowerBand, upperBand) [line_, _direction, lowerBand, upperBand] [line_, _direction, lowerBand, upperBand] = trend_line(factor) // } // PLOT ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――{ t_col = _direction == 1 ? col_dn : col_up plot(line_, "TrendLine", color = color.new(t_col, 0), linewidth = 4) plot(line_, "TrendLine", color = color.new(t_col, 80), linewidth = 10) plot(lowerBand+dist, "LowerBand1", color = _direction == -1 ? color.new(t_col, 80) : color.new(t_col, 100), linewidth = 1) plot(lowerBand+dist*0.5, "LowerBand2", color = _direction == -1 ? color.new(t_col, 60) : color.new(t_col, 100), linewidth = 1) plot(lowerBand, "LowerBand3", color = _direction == -1 ? color.new(t_col, 40) : color.new(t_col, 100), linewidth = 1) plot(lowerBand-dist*0.5, "LowerBand4", color = _direction == -1 ? color.new(t_col, 20) : color.new(t_col, 100), linewidth = 1) plot(lowerBand-dist, "LowerBand5", color = _direction == -1 ? color.new(t_col, 0) : color.new(t_col, 100), linewidth = 1) plot(upperBand+dist, "UpperBand5", color = _direction == 1 ? color.new(t_col, 0) : color.new(t_col, 100), linewidth = 1) plot(upperBand+dist*0.5, "UpperBand4", color = _direction == 1 ? color.new(t_col, 20) : color.new(t_col, 100), linewidth = 1) plot(upperBand, "UpperBand3", color = _direction == 1 ? color.new(t_col, 40) : color.new(t_col, 100), linewidth = 1) plot(upperBand-dist*0.5, "UpperBand2", color = _direction == 1 ? color.new(t_col, 60) : color.new(t_col, 100), linewidth = 1) plot(upperBand-dist, "UpperBand1", color = _direction == 1 ? color.new(t_col, 80) : color.new(t_col, 100), linewidth = 1) plotcandle(open, high, low, close, title='CandleStick Coloring', color = color.new(t_col, 50), wickcolor=color.new(t_col, 50), bordercolor = color.new(t_col, 50)) // }

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