Boite RENKO et ATR

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #238728 quote
    finplusfinplus
    Participant
    Master

    Bonjour,

    j’ai lu en parcourant le site qu’il était possible de coupler l’indicateur “Boite RENKO” avec l’ATR mais je n’ai pas réussi à trouver les lignes de code.

    Quelqu’un pourrait-il me donner un lien ou la solution ?

    Merci d’avance.

    #238814 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Holà. Il a récupéré un code programmé pour calculer les médias mobiles à partir du renko. A vers si te vale.

    //—settings
    boxsize=8//8//100//8 //renko bricks size in points/pips
    transparency=100 //brick colours alpha
    wicksize=0 //width of wicks
    //—end of settings
    //EMA7=exponentialaverage [7](close)
    size=boxsize*pointsize
    
    once upbox = close
    once downbox = close - size
    once lowwick = close*100
    
    IF close > upbox + size THEN
    upbox = upbox + size
    downbox = downbox + size
    r=0
    g=200
    begin=barindex
    highwick=close
    wickbar=barindex-round((barindex-begin[1])/2)
    ELSIF close < downbox - size THEN
    upbox = upbox - size
    downbox = downbox - size
    r=200
    g=0
    begin=barindex
    wickbar=barindex-round((barindex-begin[1])/2)
    ENDIF
    
    //draw renko candlesticks
    drawcandle(upbox,upbox,downbox,downbox)coloured(r,g,0,min(transparency,255))
    
    Mid  = (upbox+downbox)/2
    EMA7 = ExponentialAverage[7](Mid)
    EMA20 = ExponentialAverage[20](Mid)
    EMA50 = ExponentialAverage[50](Mid)
    
    atr=averagetruerange[14](Mid)
    factor=1
    
    RETURN Mid-factor*atr
    #238816 quote
    finplusfinplus
    Participant
    Master

    Merci. Je vais essayer. En fait, je ne savais pas où positionner l’ATR.

    #238817 quote
    finplusfinplus
    Participant
    Master
    Et par rapport à cet indicateur : où placer l’ATR SVP ?
    //PRC_Renko Bricks with Wicks | indicator
    //22.05.2017
    //Sharing ProRealTime knowledge
    //—settings
    //boxsize=20 //renko bricks size in points/pips
    //transparency=50 //brick colours alpha
    //wicksize=1 //width of wicks
    //—end of settings
    size=boxsize*pointsize
    once upbox = close
    once downbox = close size
    once lowwick = close*100
    IF close > upbox + size THEN
    upbox= upbox + size
    downbox= downbox + size
    r=0
    g=200
    begin=barindex
    highwick=close
    wickbar=barindexround((barindexbegin[1])/2)
    ELSIF close < downbox size THEN
    upbox= upbox size
    downbox= downbox size
    r=200
    g=0
    begin=barindex
    wickbar=barindexround((barindexbegin[1])/2)
    ENDIF
    //saving current high/low
    highwick=max(high,highwick)
    lowwick=min(low,lowwick)
    //compute wicks at each new contrarian brick
    if r>0 and r[1]=0 then
    //new red brick
    drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
    lowwick=low*100
    highwick=0
    endif
    if r=0 and r[1]>0 then
    //new green brick
    drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
    lowwick=low*100
    highwick=0
    endif
    //compute wicks at each new same brick
    if r>0 and r[1]>0 and lastdrawn<>wickbar then
    //new red brick
    if highwick>upbox[1] then
      drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
    endif
    lastdrawn=wickbar
    lowwick=low*100
    highwick=0
    endif
    if r=0 and r[1]=0 and lastdrawn<>wickbar then
    //new green brick
    if lowwick<downbox[1] then
      drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
    endif
    lastdrawn=wickbar
    lowwick=low*100
    highwick=0
    endif
    //draw renko candlesticks
    drawcandle(upbox,upbox,downbox,downbox)coloured(r,g,0,min(transparency,255))
    RETURN
    #238851 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Sería algo así, aunque no tiene mucho sentido…

    //PRC_Renko Bricks with Wicks | indicator
    //22.05.2017
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    //—settings
    boxsize=20 //renko bricks size in points/pips
    transparency=50 //brick colours alpha
    wicksize=1 //width of wicks
    //—end of settings
    size=boxsize*pointsize
    once upbox = close
    once downbox = close - size
    once lowwick = close*100
    IF close > upbox + size THEN
    upbox= upbox + size
    downbox= downbox + size
    r=0
    g=200
    begin=barindex
    highwick=close
    wickbar=barindex-round((barindex-begin[1])/2)
    myclose=upbox
    ELSIF close < downbox - size THEN
    upbox= upbox - size
    downbox= downbox - size
    r=200
    g=0
    begin=barindex
    wickbar=barindex-round((barindex-begin[1])/2)
    myclose=downbox
    ENDIF
    //saving current high/low
    highwick=max(high,highwick)
    lowwick=min(low,lowwick)
    //compute wicks at each new contrarian brick
    if r>0 and r[1]=0 then
    //new red brick
    drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
    lowwick=low*100
    highwick=0
    endif
    if r=0 and r[1]>0 then
    //new green brick
    drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
    lowwick=low*100
    highwick=0
    endif
    //compute wicks at each new same brick
    if r>0 and r[1]>0 and lastdrawn<>wickbar then
    //new red brick
    if highwick>upbox[1] then
    drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
    endif
    lastdrawn=wickbar
    lowwick=low*100
    highwick=0
    endif
    if r=0 and r[1]=0 and lastdrawn<>wickbar then
    //new green brick
    if lowwick<downbox[1] then
    drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
    endif
    lastdrawn=wickbar
    lowwick=low*100
    highwick=0
    endif
    //draw renko candlesticks
    drawcandle(upbox,upbox,downbox,downbox)coloured(r,g,0,min(transparency,255))
    factor=1
    atr=averagetruerange[14](myclose)
    RETURN myclose, myclose-factor*atr
    #238951 quote
    finplusfinplus
    Participant
    Master

    Merci. En fait, l’objectif est d’adapter les tailles des boîtes à la volatilité du sous-jacent.

Viewing 6 posts - 1 through 6 (of 6 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

Boite RENKO et ATR


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by finplusfinplus
1 year, 11 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/08/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...