Traduction indicateur TradingView "Pivot Point SuperTrend"

Forums ProRealTime forum Français Support ProBuilder Traduction indicateur TradingView "Pivot Point SuperTrend"

Viewing 5 posts - 1 through 5 (of 5 total)
  • #136795

    Bonjour,

    J’ai repéré cet indicateur sur la plateforme TradingView qui me semble une alternative intéressante au classique Supertrend.

    Si quelqu’un avait les compétences pour le traduire en code ProRealTime, je lui serais très reconnaissant.

    Je mets le code TradingView ci-dessous et le lien vers le descriptif sur la plateforme TradingView

    Merci d’avance pour votre aide

    https://www.tradingview.com/script/L0AIiLvH-Pivot-Point-Supertrend/

    Le code ci-dessous :

    study(“Pivot Point SuperTrend”, overlay = true)
    prd = input(defval = 2, title=”Pivot Point Period”, minval = 1, maxval = 50)
    Factor=input(defval = 3, title = “ATR Factor”, minval = 1, step = 0.1)
    Pd=input(defval = 10, title = “ATR Period”, minval=1)
    showpivot = input(defval = false, title=”Show Pivot Points”)
    showlabel = input(defval = true, title=”Show Buy/Sell Labels”)
    showcl = input(defval = false, title=”Show PP Center Line”)
    showsr = input(defval = false, title=”Show Support/Resistance”)

    float ph = na
    float pl = na
    ph := pivothigh(prd, prd)
    pl := pivotlow(prd, prd)

    plotshape(ph and showpivot, text=”H”, style=shape.labeldown, color=na, textcolor=color.red, location=location.abovebar, transp=0, offset = -prd)
    plotshape(pl and showpivot, text=”L”, style=shape.labeldown, color=na, textcolor=color.lime, location=location.belowbar, transp=0, offset = -prd)

    float center = na
    center := center[1]
    float lastpp = ph ? ph : pl ? pl : na
    if lastpp
    if na(center)
    center := lastpp
    else
    center := (center * 2 + lastpp) / 3

    Up = center – (Factor * atr(Pd))
    Dn = center + (Factor * atr(Pd))

    float TUp = na
    float TDown = na
    Trend = 0
    TUp := close[1] > TUp[1] ? max(Up, TUp[1]) : Up
    TDown := close[1] < TDown[1] ? min(Dn, TDown[1]) : Dn
    Trend := close > TDown[1] ? 1: close < TUp[1]? -1: nz(Trend[1], 1)
    Trailingsl = Trend == 1 ? TUp : TDown

    linecolor = Trend == 1 and nz(Trend[1]) == 1 ? color.lime : Trend == -1 and nz(Trend[1]) == -1 ? color.red : na
    plot(Trailingsl, color = linecolor , linewidth = 2, title = “PP SuperTrend”)

    plot(showcl ? center : na, color = showcl ? center < hl2 ? color.blue : color.red : na, transp = 0)

    bsignal = Trend == 1 and Trend[1] == -1
    ssignal = Trend == -1 and Trend[1] == 1
    plotshape(bsignal and showlabel ? Trailingsl : na, title=”Buy”, text=”Buy”, location = location.absolute, style = shape.labelup, size = size.tiny, color = color.lime, textcolor = color.black, transp = 0)
    plotshape(ssignal and showlabel ? Trailingsl : na, title=”Sell”, text=”Sell”, location = location.absolute, style = shape.labeldown, size = size.tiny, color = color.red, textcolor = color.white, transp = 0)

    float resistance = na
    float support = na
    support := pl ? pl : support[1]
    resistance := ph ? ph : resistance[1]

    plot(showsr and support ? support : na, color = showsr and support ? color.lime : na, style = plot.style_circles, offset = -prd)
    plot(showsr and resistance ? resistance : na, color = showsr and resistance ? color.red : na, style = plot.style_circles, offset = -prd)

    alertcondition(Trend == 1 and Trend[1] == -1, title=’Buy Signal’, message=’Buy Signal’)
    alertcondition(Trend == -1 and Trend[1] == 1, title=’Sell Signal’, message=’Sell Signal’)
    alertcondition(change(Trend), title=’Trend Changed’, message=’Trend Changed’)

    #137621

    Bonjour, j’avais prévu de m’en occuper mais j’ai été un peu débordé ces derniers jours. L’indicateur en question utilise des “pivots” hauts/bas (fractals) à la place du prix pour déterminer les niveaux du SuperTrend. Bien entendu, puisque les points hauts/bas des fractals doivent attendre confirmation de X bougies, il peut avoir un peu de retard. Je vais me pencher sur la traduction du code rapidement.

    #137625

    Bonjour Nicolas,

    Merci d’avoir regardé, je vais donc patienter et ne manquerai pas de le rappeler 😉

    Bonne journée

    #137644

    L’indicateur vient d’être publié ici : Pivot point Supertrend

    1 user thanked author for this post.
    #137667

    Merci infiniment !!

Viewing 5 posts - 1 through 5 (of 5 total)

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