Demande d’information sur l’indicateur HYPERTREND

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #239308 quote
    Samir pluquin
    Participant
    Junior

    Bonjour a tous la communauté,

    je suis entrain de tester l’indicateur HYPERTREND et je voudrais afficher mes actions quand l’indicateur est en ligne verte ( tendance haussière ) et quand l’indicateur est en ligne rouge ( tendance baissière)

    pouvez vous m’aidez a coder  ce code svp

    merci beaucoup

     

    ci dessous le code source du code de l’indicateur :

    //PRC_Q-Trend | indicator
    //17.07.23
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge

    // —settings
    //p = 200 //Trend period
    //atrp = 14 //ATR Period
    //mult = 1.0 //ATR Multiplier
    //mode = 1 //Signal mode options = [1=”Type A”, 2=”Type B”]
    //useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
    //srcemaperiod = 3 //EMA Smoother period
    //colorbars = 0 //Color bars? 0=false ; 1=true
    //signalsview = 0 //0 = trend inversion ; 1 = strong buy / strong sell only
    // — end of settings

    source = customclose

    // Calculations
    if useemasmoother then
    src = average[srcemaperiod,1](source)
    else
    src=source
    endif

    hh = highest[p](src) // Highest of src p-bars back;
    ll = lowest[p](src) // Lowest of src p-bars back.
    d = hh – ll

    if barindex>p then
    once m = (hh + ll) / 2 // Initial trend line;
    atr = AverageTrueRange[atrp][1] // ATR;
    epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.

    if mode=2 then //type B
    changeup = src crosses over m+epsilon or src crosses under m+epsilon
    changedown = src crosses over m-epsilon or src crosses under m-epsilon
    else
    changeup = src crosses over m+epsilon or src > m+epsilon
    changedown = src crosses under m-epsilon or src < m-epsilon
    endif

    sb = open < ll + d / 8 and open >= ll
    ss = open > hh – d / 8 and open <= hh
    strongbuy = sb or sb[1] or sb[2] or sb[3] or sb[4]
    strongsell = ss or ss[1] or ss[2] or ss[3] or ss[4]

    if (changeup or changedown) then
    if changeup then
    m=m + epsilon
    elsif changedown then
    m=m – epsilon
    endif
    else
    m=m[1]
    endif

    if changeup then
    r=0
    g=255
    elsif changedown then
    r=255
    g=0
    endif

    if colorbars then
    drawcandle(open,high,low,close)coloured(r,g,0)
    endif

    if signalsview=1 then
    if strongbuy and ls<>1 then
    drawtext(“▲”,barindex,low) coloured(“lime”)
    ls=1
    endif
    if strongsell and ls<>-1 then
    drawtext(“▼”,barindex,high) coloured(“red”)
    ls=-1
    endif
    else
    if r<>r[1]and r>0 then
    drawtext(“▼”,barindex[1],m[1]) coloured(“red”)
    endif
    if r<>r[1]and r=0 then
    drawtext(“▲”,barindex[1],m[1]) coloured(“lime”)
    endif
    endif
    endif

    RETURN m style(line,3) coloured(r,g,0)

    #239164 quote
    Samir pluquin
    Participant
    Junior

    Bonjour a tous les codeurs

    j’espère que tous ce passe à merveille pour vous =)

    j’ai un petit souci, j’utilise actuellement l’indicateur hypertrend et je souhaiterais afficher plusieurs conditions ,

    pour les achats ;

    1 ) début de la barre verte de l’hypertrend

    2) close en dessous de la barre verte de l’hypertrend

     

    Pour les ventes,

    1)  début de la barre rouge de l’hypertrend

    2) close au dessus de la barre rouge de l’hypertrend

     

    Si vous pouvez m’aider sur ces 4 variables a coder sa serait sympas =)

    je vous mets le code sources de l’indicateur ci dessous

    merci beaucoup pour votre aide

    code source de l’indicateurs :

    once avg = close
    once hold = 0
    once os = 1
    once rR = 220
    once gR = 20
    once bR = 60
    once rV = 60
    once gV = 179
    once bV = 113

    if barindex > 200 then
    atr = AverageTrueRange[200] * mult

    If abs(close – avg) > atr then
    avg = (close+avg)/2
    //avg = avgN
    else
    avg = avg + os*(hold/mult/slope)
    //avg = avgN
    endif

    os = sgn(avg – avg[1])

    If os <> os[1] then
    hold = atr
    else
    hold = hold[1]
    endif

    upper = avg + width*hold/100
    lower = avg – width*hold/100

    If os = 1 then
    r = rV
    g = gV
    b = bV
    else
    r = rR
    g = gR
    b = bR
    endif

    DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
    DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
    DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
    ColorBetween(avg,upper,rR,gR,bR,30)
    ColorBetween(avg,lower,rV,gV,bV,30)

    endif

    Return

    #239180 quote
    Iván González
    Moderator
    Master

    Buenas. J'espère avoir entendu ce que je cherchais…

    mult=5
    slope=14
    width=80
    once avg = close
    once hold = 0
    once os = 1
    once rR = 220
    once gR = 20
    once bR = 60
    once rV = 60
    once gV = 179
    once bV = 113
    
    if barindex > 200 then
    atr = AverageTrueRange[200] * mult
    
    If abs(close - avg) > atr then
    avg = (close+avg)/2
    //avg = avgN
    else
    avg = avg + os*(hold/mult/slope)
    //avg = avgN
    endif
    
    os = sgn(avg - avg[1])
    
    If os <> os[1] then
    hold = atr
    else
    hold = hold[1]
    endif
    
    upper = avg + width*hold/100
    lower = avg - width*hold/100
    
    If os = 1 then
    if os<>os[1] then
    drawarrowup(barindex,low)coloured("green")
    endif
    r = rV
    g = gV
    b = bV
    else
    if os<>os[1] then
    drawarrowdown(barindex,high)coloured("red")
    endif
    r = rR
    g = gR
    b = bR
    endif
    
    DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
    DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
    DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
    ColorBetween(avg,upper,rR,gR,bR,30)
    ColorBetween(avg,lower,rV,gV,bV,30)
    
    endif
    
    Return
    

    Si ce n’est pas le cas, marquez sur un graphique ce que vous souhaitez automatiser.

    Samir pluquin thanked this post
    #239240 quote
    Samir pluquin
    Participant
    Junior

    merci beaucoup pour votre retour cela est très utile pour le code =)

    mais comment fait ont pour faire un screen avec  une seule conditions à la fois  ,

    c’est a dire d’abord faire un screen avec seulement la conditions 1 pour les achats , ensuite faire un autre screen seulement avec la conditions 2 pour les achats , et par la suite la même chose pour les ventes.

    merci beaucoup pour votre retour et bonne journée a vous =)

    #239328 quote
    Iván González
    Moderator
    Master

    Bonjour,
    Pour réaliser un screen avec une seule condition à la fois, voici comment procéder :
    Pour les achats : Début de la barre verte de l’Hypertrend.
    Vous pouvez créer le screener ainsi :

    if os = 1 and os <> os[1] then
        conditionLong = 1
    else
        conditionLong = 0
    endif
    screener[conditionLong]
    

    Pour les ventes : Début de la barre rouge de l’Hypertrend.
    Voici le code pour cette condition :

    if os = -1 and os <> os[1] then
        conditionShort = 1
    else
        conditionShort = 0
    endif
    screener[conditionShort]
    
    #239376 quote
    Iván González
    Moderator
    Master
    //17.07.23
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // —settings
    p = 200 //Trend period
    atrp = 14 //ATR Period
    mult = 1.0 //ATR Multiplier
    mode = 1 //Signal mode options = [1="Type A", 2="Type B"]
    useemasmoother = 0 //Smooth source with EMA? 0=false ; 1=true
    srcemaperiod = 3 //EMA Smoother period
    
    // — end of settings
    
    source = customclose
    
    // Calculations
    if useemasmoother then
    src = average[srcemaperiod,1](source)
    else
    src=source
    endif
    
    hh = highest[p](src) // Highest of src p-bars back;
    ll = lowest[p](src) // Lowest of src p-bars back.
    
    if barindex>p then
    once m = (hh + ll) / 2 // Initial trend line;
    atr = AverageTrueRange[atrp][1] // ATR;
    epsilon = mult * atr // Epsilon is a mathematical variable used in many different theorems in order to simplify work with mathematical object. Here it used as sensitivity measure.
    
    if mode=2 then //type B
    changeup = src crosses over m+epsilon or src crosses under m+epsilon
    changedown = src crosses over m-epsilon or src crosses under m-epsilon
    else
    changeup = src crosses over m+epsilon or src > m+epsilon
    changedown = src crosses under m-epsilon or src < m-epsilon
    endif
    
    if (changeup or changedown) then
    if changeup then
    m=m + epsilon
    elsif changedown then
    m=m - epsilon
    endif
    else
    m=m[1]
    endif
    
    if changeup then
    r=0
    elsif changedown then
    r=255
    endif
    
    if r<>r[1]and r>0 then
    short=1
    else
    short=0
    endif
    if r<>r[1]and r=0 then
    long=1
    else
    long=0
    endif
    endif
    
    screener[long or  short](long as "Long", short as "Short")
    

    Ici tu as :

    Samir pluquin thanked this post
    #239381 quote
    Samir pluquin
    Participant
    Junior

    merci beaucoup pour votre retour ,

     

    mais pouvez vous m’aidez a coder une conditions à la fois  svp

     

    c’est a dire indiquer le code seulement a effectuer pour les achats et ensuite indiquer le code pour les ventes

     

    merci beaucoup de votre aide

    #244233 quote
    Samir pluquin
    Participant
    Junior

    Bonjour a tous la communauté =)

    je suis entrain de tester l’indicateur HYPERTREND,

    pouvez vous m’aider a coder un proscreener lorsque la tendance est verte et que le prix est en dessous de la barre verte svp ( ci joint une prise écran )

    merci à tous de votre aide

    ci dessous le code source de l’indicateur

    once avg = close
    once hold = 0
    once os = 1
    once rR = 220
    once gR = 20
    once bR = 60
    once rV = 60
    once gV = 179
    once bV = 113
     
    if barindex > 200 then
    atr = AverageTrueRange[200] * mult
     
     
    If abs(close - avg) > atr then
    avg = (close+avg)/2
    //avg = avgN
    else
    avg = avg + os*(hold/mult/slope)
    //avg = avgN
    endif
     
    os = sgn(avg - avg[1])
     
    If os <> os[1] then
    hold = atr
    else
    hold = hold[1]
    endif
     
    upper = avg + width*hold/100
    lower = avg - width*hold/100
     
    If os = 1 then
    r = rV
    g = gV
    b = bV
    else
    r = rR
    g = gR
    b = bR
    endif
     
    DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
    DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
    DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
    ColorBetween(avg,upper,rR,gR,bR,30)
    ColorBetween(avg,lower,rV,gV,bV,30)
     
    endif
     
    Return
    prix-en-dessous-de-la-ligne-verte.png prix-en-dessous-de-la-ligne-verte.png
    #244289 quote
    robertogozzi
    Moderator
    Master

    Voici le code (je joins également le fichier ITF) :

    once mult = 5
    once slope= 14
    //once width= 80
    once avg  = close
    once hold = 0
    once os   = 1
    //once rR   = 220
    //once gR   = 20
    //once bR   = 60
    //once rV   = 60
    //once gV   = 179
    //once bV   = 113
    Flag      = 0
    if barindex > 200 then
    atr = AverageTrueRange[200] * mult
    
    
    If abs(close - avg) > atr then
    avg = (close+avg)/2
    //avg = avgN
    else
    avg = avg + os*(hold/mult/slope)
    //avg = avgN
    endif
    
    os = sgn(avg - avg[1])
    
    If os <> os[1] then
    hold = atr
    else
    hold = hold[1]
    endif
    
    //upper = avg + width*hold/100
    //lower = avg - width*hold/100
    
    If os = 1 then
    //r = rV
    //g = gV
    //b = bV
    Flag = 1
    else
    //r = rR
    //g = gR
    //b = bR
    Flag = 2
    endif
    
    //DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
    //DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
    //DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
    //ColorBetween(avg,upper,rR,gR,bR,30)
    //ColorBetween(avg,lower,rV,gV,bV,30)
    
    endif
    Signal = 0
    IF (Flag = 1) and (close < avg) THEN
    Signal = 1
    endif
    SCREENER[Signal AND (high <> low)]
    Iván González and Samir pluquin thanked this post
    My-Screener.itf
    #244311 quote
    Samir pluquin
    Participant
    Junior

    Bonjour robertogozzi 

    merci beaucoup de vote retour, par la même occasions

    pouvez vous m’aider a coder un proscreener lorsque la tendance est rouge et que le prix est au dessus de la barre rouge svp ( ci joint une prise écran )

    cordialement

    prix-au-dessus-de-la-ligne-rouge-de-tendance.png prix-au-dessus-de-la-ligne-rouge-de-tendance.png
    #244320 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    once mult = 5
    once slope= 14
    //once width= 80
    once avg  = close
    once hold = 0
    once os   = 1
    //once rR   = 220
    //once gR   = 20
    //once bR   = 60
    //once rV   = 60
    //once gV   = 179
    //once bV   = 113
    Flag      = 0
    if barindex > 200 then
    atr = AverageTrueRange[200] * mult
    
    
    If abs(close - avg) > atr then
    avg = (close+avg)/2
    //avg = avgN
    else
    avg = avg + os*(hold/mult/slope)
    //avg = avgN
    endif
    
    os = sgn(avg - avg[1])
    
    If os <> os[1] then
    hold = atr
    else
    hold = hold[1]
    endif
    
    //upper = avg + width*hold/100
    //lower = avg - width*hold/100
    
    If os = 1 then
    //r = rV
    //g = gV
    //b = bV
    Flag = 1
    else
    //r = rR
    //g = gR
    //b = bR
    Flag = 2
    endif
    
    //DRAWSEGMENT(barindex-1,avg[1],barindex,avg) COLOURED(r,g,b,255)style(line,3)
    //DRAWSEGMENT(barindex-1,upper[1],barindex,upper) COLOURED(rR,gR,bR,100)style(line,1)
    //DRAWSEGMENT(barindex-1,lower[1],barindex,lower) COLOURED(rV,gV,bV,100)style(line,1)
    //ColorBetween(avg,upper,rR,gR,bR,30)
    //ColorBetween(avg,lower,rV,gV,bV,30)
    
    endif
    Signal = 0
    IF (Flag = 2) and (close > avg) THEN
    Signal = 2
    endif
    SCREENER[Signal AND (high <> low)]
    My-Screener-2.itf
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Demande d’information sur l’indicateur HYPERTREND


ProScreener : Scanners de Marché & Détection

New Reply
Author
Summary

This topic contains 10 replies,
has 3 voices, and was last updated by robertogozzi
1 year ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 10/17/2024
Status: Active
Attachments: No files
Logo Logo
Loading...