chandelier multi timeframe

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #200390 quote
    Armand2020
    Participant
    Senior

    bonjour , j aimerai pouvoir avoir des chandelier de 5 minute sur du 1 minute, mais avec ce code je n ai reussi qu a avoir des chandelier de 1 heure, quelqu un aurai des piste

    merci

    TIMEFRAME (60 MINUTE)
    TwoUp = high > high[1] and low > low[1]
    TwoDown = low < low[1] and high < high[1]
    InsideBar = high =< high[1] and low >= low[1]
    OutsideBar = high > high[1] and low < low[1]
    
    
    TIMEFRAME (DEFAULT)
    IF Dy then
    if MINUTE[1]>MINUTE then
    jhh = Highest[BarIndex - lastdaybarindex](High)[0]
    jll = Lowest[BarIndex - lastdaybarindex](Low)[0]
    lastdaybarindex = BarIndex
    jstartbar = barindex+1
    jo = open[BarIndex - lastdaybarindex]
    jc = close[1]
    jbmid = ((barindex-1)+jstartbar[1])/2
    
    
    IF INSIDEBAR THEN
    DRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,255,250,30)BORDERCOLOR(255,255,250,130)
    
    endif
    
    IF TWOUP THEN
    DRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(0,200,250,30)BORDERCOLOR(0,200,250,130)
    
    endif
    
    /////////////////////////////////////////////////////////////////////////////////////////
    IF TWODOWN THEN
    DRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,0,0,30)BORDERCOLOR(255,0,0,100)
    
    endif
    
    IF OUTSIDEBAR THEN
    DRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,0,250,30)BORDERCOLOR(255,0,250,100)
    
    endif
    
    
    ENDIF
    
    ENDIF
    
    
    /////////////////////////////////////////////////////////////////////////////////////////
    return
    
    
    
    
    #200409 quote
    Nicolas
    Keymaster
    Master

    Pour obtenir les valeurs OHLC des bougies 5 minutes, tu peux faire comme ceci:

    timeframe(5 minutes)
    open5 = open
    high5 = high
    low5 = low
    close5 = close
    
    timeframe(default)
    
    return open5,high5,low5,close5

    ici ça retournera des lignes, mais on pourrait tracer tout cela autrement avec ces variables.

    Armand2020 thanked this post
    #200419 quote
    Armand2020
    Participant
    Senior
    if MINUTE[1]>MINUTE then
    jhh = Highest[BarIndex - lastdaybarindex](High)[0]
    jll = Lowest[BarIndex - lastdaybarindex](Low)[0]
    lastdaybarindex = BarIndex
    jstartbar = barindex+1

    en fait c est cette partie de code que je ne sais pas faire, comment definir le debut (jstartbar) et la fin de la periode de 5min pour pouvoir tracer le rectangle?

    #200423 quote
    Nicolas
    Keymaster
    Master

    Cette version rapide trace les chandeliers en cours de construction:

    timeframe(5 minutes)
    open5 = open
    high5 = high
    low5 = low
    close5 = close
    
    timeframe(default)
    if open5<>lastopen then 
    lastopen=open5
    startbar=barindex
    endif 
    
    if open5<close5 then 
    r=0
    g=255
    else
    r=255
    g=0
    endif
    
    drawrectangle(startbar,open5,barindex,close5) coloured(r,g,0,50) bordercolor(0,0,0,0)
    drawsegment(startbar+3,max(open5,close5),startbar+3,high5) style(line,2)
    drawsegment(startbar+3,min(open5,close5),startbar+3,low5)style(line,2)
    
    return //open5,high5,low5,close5
    Armand2020 thanked this post
    #200430 quote
    Armand2020
    Participant
    Senior

    J’ai trouver le code sur le forum que j ai un peu tranformer pour qu il colle l ancien , je le poste pour si ca peut aider quelqu un.

    TIMEFRAME (5 MINUTE)
    TwoUp = high > high[1] and low > low[1]
    TwoDown = low < low[1] and high < high[1]
    InsideBar = high =< high[1] and low >= low[1]
    OutsideBar = high > high[1] and low < low[1]
    
    TIMEFRAME(DEFAULT)
    C5 = close
    If OpenMinute MOD 5 = 0 Then //Reset variables each new 5-minute bar
    O5 = open
    H5 = high
    L5 = low
    Else
    H5 = max(H5,high)
    L5 = min(L5,low)
    Endif
     
    If c5<o5 then
    r=255
    g=0
    b=0
    else
    r=0
    g=255
    b=0
    endif
     
    If OpenMinute MOD 5 = 4 Then  //plot only when the 5-minute bar closes
    //Drawrectangle(BarIndex - 4,H5,BarIndex,L5)             Coloured(r,g,b,255)   //Body
    //DrawRectangle(BarIndex - 2,max(O5,C5),BarIndex - 2,H5) Coloured(r,g,b,255)   //Upper Wick
    //DrawRectangle(BarIndex - 2,min(O5,C5),BarIndex - 2,L5) Coloured(r,g,b,255)   //Lower Wick
    
    
    IF INSIDEBAR THEN
    Drawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,255,250,30)BORDERCOLOR(255,255,250,130)
    
    endif
    
    IF TWOUP THEN
    Drawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(0,200,250,30)BORDERCOLOR(0,200,250,130)
    
    endif
    
    /////////////////////////////////////////////////////////////////////////////////////////
    IF TWODOWN THEN
    Drawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,0,0,30)BORDERCOLOR(255,0,0,100)
    
    endif
    
    IF OUTSIDEBAR THEN
    Drawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,0,250,30)BORDERCOLOR(255,0,250,100)
    
    endif
    ENDIF
    Return
    
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

chandelier multi timeframe


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Armand2020 @armand2020 Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/08/2022
Status: Active
Attachments: No files
Logo Logo
Loading...