indicateur double supertrend

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #177412 quote
    sylvergtisylvergti
    Participant
    Junior

    Bonjour , je ne suis pas du tout capable de faire un indicateur , comme j aurai besoin d aide pour celui-ci, c est un double supertrend, je met le code que j ai trouvé sur trading view pour mieux comprendre

    //Crée par J.Dow
    //Double SuperTrend ATR, Le type ATR calcule la volatilité à partir de l’Average True Range (ATR), il est idéal pour le FOREX

    study(title = “Double SuperTrend ATR”, shorttitle = “Double SuperTrend ATR”, overlay = true)

    //Mode
    Factor=input(title=”Super Trend”, defval=3, minval=1,maxval = 100)
    ATR=input(title=”ATR”, defval=12, minval=1,maxval = 100)

    //Super Trend ATR 1
    Up=hl2-(Factor*atr(ATR))
    Dn=hl2+(Factor*atr(ATR))

    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)

    Tsl1 = Trend==1? TUp: TDown
    Tsl2 = Trend==1? TDown: TUp

    linecolor = Trend == 1 ? green : red

    //Affichage
    P1 = plot(Tsl1, color = linecolor , style = line , linewidth = 1,title = “SuperTrend ATR-1”)
    P2 = plot(Tsl2, color = linecolor , style = line , linewidth = 1,title = “SuperTrend ATR-2”)
    fill(P1, P2, color = linecolor == red ? red : green)

     

    D avance un grand merci

    #177416 quote
    NicolasNicolas
    Keymaster
    Legend

    Ci-joint le code de ce double Supertrend pour ProRealTime:

    //Mode
    Factor=3
    ATR=12
    
    //Super Trend ATR 1
    hl2=medianprice
    atr=AverageTrueRange[ATR](close)
    Up=hl2-(Factor*atr)
    Dn=hl2+(Factor*atr)
    
    if close[1]>TUp[1] then 
    Tup= max(Up,TUp[1]) 
    else
    Tup= Up
    endif
    if close[1]<TDown[1] then 
    Tdown= min(Dn,TDown[1]) 
    else
    TDown= Dn
    endif
    
    if close > TDown[1] then 
    trend= 1 
    r=0
    g=255
    elsif close< TUp[1] then 
    trend= -1
    r=255
    g=0
    else
    trend=Trend[1]
    endif
    
    if Trend=1 then 
    tsl1= TUp
    else
    tsl1= TDown
    endif
    if Trend=1 then 
     tsl2=TDown
    else
    tsl2= TUp
    endif
    
    return tsl1 coloured(r,g,0), tsl2 coloured(r,g,0)
    double-supertrend.png double-supertrend.png
    #177447 quote
    sylvergtisylvergti
    Participant
    Junior

    un grand merci Nicolas, C est du rapide…

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

indicateur double supertrend


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
sylvergti @sylvergti Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by sylvergtisylvergti
5 years ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/13/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...