Question sur Renko et Supertrend

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #195656 quote
    reb
    Participant
    Master

    Bonjour à tous

    J’essaie de coder un indicateur avec un graph en briques renko (briques de 5 pts) et un supertrend (3 10) qui m’alerte lorsque les conditions suivantes sont réunies :

    Après un changement de sens du Supertrend, il y a un  1e retracement marqué par au moins une (çà peut être plusieurs tant que le supertrend ne s’inverse pas) brique dans le sens contraire à la tendance initiée par le changement de sens du supertrend

    Afin de clarifier, en PJ voici  différents exemples pris sur le DAX aujourd’hui (marqués par les ellipses)

    Idéalement, je souhaiterais un indicateur de type -1;1 ( pour mettre un histogramme ) et avoir le cours max de la brique renko la plus haute (pour un long) à afficher sur le graph

     

    Merci d’avance

     

    Reb

    Dax-20-06-2022.jpg Dax-20-06-2022.jpg
    #195711 quote
    Nicolas
    Keymaster
    Master

    Ci-joint le code de cette stratégie, je pense que tout y est, j’ai ajouté des flèches au moment où on trouve le signal. A vérifier, ça me rappelle un truc qui passe sur Twitter en ce moment.

    st=Supertrend[3,10] 
    green=close>open
    red=close<open
    
    if close crosses over st  then 
    trendbar=barindex
    hh=0
    trend=1
    endif
    if close crosses under st then 
    trendbar=barindex
    ll=0
    trend=-1
    endif
    
    if trend=1 then 
    hh=max(close,hh)
    endif
    
    if trend=-1 then 
    if ll=0 then 
    ll=close
    endif
    ll=min(close,ll)
    endif
    
    rup = trend=1 and green and red[1] and lastr<trendbar
    rdn = trend=-1 and red and green[1] and lastr<trendbar
    
    signal=0
    if rup then 
    lastr=barindex
    drawarrowup(barindex,low) coloured("green")
    signal=1
    endif 
    if rdn then
    lastr=barindex
    drawarrowdown(barindex,high) coloured("crimson")
    signal=-1
    endif
    
    return signal as "trading signals", hh as "plus haut", ll as "plus bas"
    reb thanked this post
    signals-renko-strategie.png signals-renko-strategie.png
    #195775 quote
    reb
    Participant
    Master

    merci chef

    Effectivement, c’est un set up d’une formation (que j’ai acquise) et le vendeur de cette dernière poste régulièrement sur twitter

    Idéalement, il faudrait que la fleche apparaisse lorsque la brique retrouve le plus haut (cad que le 1e retracement est lui même complètement retracé)

     

    Peux-tu modifier çà ?

     

    Merci d’avance,

    #195814 quote
    Nicolas
    Keymaster
    Master

    Ok, je pense que dans cette version tout y est 🙂 C’est un setup type 123 du coup.

    st=Supertrend[3,10]
    green=close>open
    red=close<open
    
    if close crosses over st  then
    trendbar=barindex
    hh=0
    trend=1
    endif
    if close crosses under st then
    trendbar=barindex
    ll=0
    trend=-1
    endif
    
    if trend=1 then
    hh=max(close,hh)
    endif
    
    if trend=-1 then
    if ll=0 then
    ll=close
    endif
    ll=min(close,ll)
    endif
    
    retraceup = green and red[1]
    retracedn = red and green[1]
    
    if retraceup or retracedn then 
    retracebar = barindex
    endif 
    
    rup = trend=1 and retracebar>trendbar and lastr<trendbar and close > hh[1]
    rdn = trend=-1 and retracebar>trendbar and lastr<trendbar and close < ll[1]
    
    signal=0
    if rup then
    lastr=barindex
    drawarrowup(barindex,low) coloured("green")
    signal=1
    endif
    if rdn then
    lastr=barindex
    drawarrowdown(barindex,high) coloured("crimson")
    signal=-1
    endif
    
    return signal as "trading signals", hh as "plus haut", ll as "plus bas"
    
    reb thanked this post
    setup-123-renko.png setup-123-renko.png
    #195892 quote
    reb
    Participant
    Master

    c’est parfait merci

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

Question sur Renko et Supertrend


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
reb @reb Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by reb
3 years, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/20/2022
Status: Active
Attachments: 3 files
Logo Logo
Loading...