Optimisation affichage des ranges

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #254369 quote
    Med5
    Participant
    New

    Bonjour,

    J’utilise un indicateur de détection de range/inside bars inspiré de celui posté par @LucasBest que je trouve top, mais je voudrais l’optimiser pour qu’il soit plus lisible pour mon utilisation.

    Actuellement, il affiche tous les ranges détectés, et ça surcharge énormément mon graphique.

    Je cherche à n’afficher que deux ranges maximum à la fois :

    1. Le range actuel en formation (en violet).

    2. Le dernier range qui a été cassé (qui devient vert).

    Dès qu’un nouveau range violet est cassé, il prend la place de l’ancien vert, et on attend le nouveau violet. L’idée est de n’avoir qu’un seul vert (le dernier cassé) et un seul violet (l’actuel).

    Merci beaucoup pour votre aide ! 🙏

    DefParam DrawOnLastBarOnly = true
    
    once candleLow = low
    once candleHigh = high
    once candleOpen = open
    once candleClose = close
    once insideCandles = 1
    once RangeIndex = 0
    
    MyTR = max(Range, max(abs(high - close[1]), abs(low - close[1])))
    
    if high > candleHigh[1] and close <= candleHigh[1] then
    candleHigh = high
    endif
    
    if low < candleLow[1] and close >= candleLow[1] then
    candleLow = low
    endif
    
    breakoutCandle = close > candleHigh or close < candleLow
    bullishBreak = close > candleHigh[1] and insideCandles[1] >= (minLemgth+1)
    bearishBreak = close < candleLow[1] and insideCandles[1] >= (minLemgth+1)
    
    candleMiddle = (candleHigh + candleLow)/2
    
    FiltreBreakoutCandle1 = (Average[2](MyTR[0]) > F*Average[20](MyTR[1]) and breakindex >= barindex-1)
    FiltreBreakoutCandle2 = 0
    FiltreBreakoutCandle3 = 0
    
    If insideCandles >= 3 then
    upside = insideCandles>=3 and summation[ceil((insideCandles+1)/2)](close>=candleMiddle) = ceil((insideCandles+1)/2)
    downside = insideCandles>=3 and summation[ceil((insideCandles+1)/2)](close<=candleMiddle) = ceil((insideCandles+1)/2)
    FiltreBreakoutCandle2 = upside or downside
    FiltreBreakoutCandle3 = (close >= candleHigh[2] or close <= candleLow[2]) and insideCandles>=2
    endif
    
    if breakoutCandle or (filtre and ((FilteringMethod=1 and FiltreBreakoutCandle1) or (FilteringMethod=2 and FiltreBreakoutCandle2) or (FilteringMethod=3 and FiltreBreakoutCandle3))) then
    
    If not breakoutCandle and (filtre and FilteringMethod=2 and FiltreBreakoutCandle2) then
    
    if upside then
    candleLow = lowest[ceil((insideCandles+1)/2)](low)
    candleHigh = candleHigh
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    
    elsif downside then
    candleLow = candleLow
    candleHigh = highest[ceil((insideCandles+1)/2)](high)
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    endif
    
    else
    candleLow = low
    candleHigh = high
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    endif
    
    If insideCandles[1] >= (minLemgth) and insideCandles = 1 then
    
    If close > candleHigh[1] then
    Drawarrowup(Barindex, Low)
    Elsif close < candleLow[1] then
    Drawarrowdown(Barindex, High)
    Endif
    
    Endif
    
    else
    insideCandles = insideCandles + 1
    
    if insideCandles >= (minLemgth) then
    
    If $RangeStart[RangeIndex] = breakindex then
    $RangeLength[RangeIndex] = insideCandles
    $RangeHigh[RangeIndex] = candleHigh
    $RangeLow[RangeIndex] = candleLow
    Else
    RangeIndex = RangeIndex + 1
    $RangeStart[RangeIndex] = breakindex
    $RangeLength[RangeIndex] = insideCandles
    $RangeHigh[RangeIndex] = candleHigh
    $RangeLow[RangeIndex] = candleLow
    Endif
    
    // Dernier rectangle (violet)
    drawsegment(breakindex, candleHigh, barindex+1, candleHigh) style(dottedline1,3) coloured(255,79,255,255)
    drawsegment(breakindex, candleLow, barindex+1, candleLow) style(dottedline1,3) coloured(255,79,255,255)
    DRAWRECTANGLE(breakindex, candleHigh, barindex+1, candleLow) coloured(255,79,255,20) bordercolor(255,79,255,200)
    drawsegment(breakindex, (candleHigh+candleLow)/2, barindex+1, (candleHigh+candleLow)/2) style(dottedline1,3) coloured(255,79,255,255)
    
    endif
    endif
    
    Fin = Max(0, RangeIndex - ($RangeStart[RangeIndex] = breakindex))
    
    If OnlyLastRange > 0 then
    Debut = Max(0, Fin - OnlyLastRange + 1 + ($RangeStart[RangeIndex] = breakindex))
    Else
    Debut = 0
    Endif
    
    If RangeIndex > 1 then
    For i = Debut to Fin do
    
    // Précédents rectangles (vert/jaune)
    drawsegment($RangeStart[i], $RangeHigh[i], $RangeStart[i]+$RangeLength[i], $RangeHigh[i]) style(line,3) coloured(198,255,0,255)
    drawsegment($RangeStart[i], $RangeLow[i], $RangeStart[i]+$RangeLength[i], $RangeLow[i]) style(line,3) coloured(198,255,0,255)
    DRAWRECTANGLE($RangeStart[i], $RangeHigh[i], $RangeStart[i]+$RangeLength[i], $RangeLow[i]) coloured(198,255,0,20) bordercolor(198,255,0,200)
    drawsegment($RangeStart[i], ($RangeHigh[i]+$RangeLow[i])/2, $RangeStart[i]+$RangeLength[i], ($RangeHigh[i]+$RangeLow[i])/2) style(dottedline1,3) coloured(198,255,0,255)
    
    Next
    Endif
    
    return
    
    #254374 quote
    LucasBest
    Participant
    Junior
    DefParam DrawOnLastBarOnly = true
    
    //Paramètres à mettre en commentaire (car déjà définis dans la configuration)
    once f=0
    once filteringmethod = 1
    once filtre = 0
    once minLemgth = 15
    //
    
    
    once candleLow = low
    once candleHigh = high
    once candleOpen = open
    once candleClose = close
    once insideCandles = 1
    once RangeIndex = 0
    
    MyTR = max(Range, max(abs(high - close[1]), abs(low - close[1])))
    
    if high > candleHigh[1] and close <= candleHigh[1] then
    candleHigh = high
    endif
    
    if low < candleLow[1] and close >= candleLow[1] then
    candleLow = low
    endif
    
    breakoutCandle = close > candleHigh or close < candleLow
    bullishBreak = close > candleHigh[1] and insideCandles[1] >= (minLemgth+1)
    bearishBreak = close < candleLow[1] and insideCandles[1] >= (minLemgth+1)
    
    candleMiddle = (candleHigh + candleLow)/2
    
    FiltreBreakoutCandle1 = (Average[2](MyTR[0]) > F*Average[20](MyTR[1]) and breakindex >= barindex-1)
    FiltreBreakoutCandle2 = 0
    FiltreBreakoutCandle3 = 0
    
    If insideCandles >= 3 then
    upside = insideCandles>=3 and summation[ceil((insideCandles+1)/2)](close>=candleMiddle) = ceil((insideCandles+1)/2)
    downside = insideCandles>=3 and summation[ceil((insideCandles+1)/2)](close<=candleMiddle) = ceil((insideCandles+1)/2)
    FiltreBreakoutCandle2 = upside or downside
    FiltreBreakoutCandle3 = (close >= candleHigh[2] or close <= candleLow[2]) and insideCandles>=2
    endif
    
    if breakoutCandle or (filtre and ((FilteringMethod=1 and FiltreBreakoutCandle1) or (FilteringMethod=2 and FiltreBreakoutCandle2) or (FilteringMethod=3 and FiltreBreakoutCandle3))) then
    
    If not breakoutCandle and (filtre and FilteringMethod=2 and FiltreBreakoutCandle2) then
    
    if upside then
    candleLow = lowest[ceil((insideCandles+1)/2)](low)
    candleHigh = candleHigh
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    
    elsif downside then
    candleLow = candleLow
    candleHigh = highest[ceil((insideCandles+1)/2)](high)
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    endif
    
    else
    candleLow = low
    candleHigh = high
    candleOpen = open
    candleClose = close
    insideCandles = 1
    breakindex = barindex
    endif
    
    If insideCandles[1] >= (minLemgth) and insideCandles = 1 then
    
    If close > candleHigh[1] then
    Drawarrowup(Barindex, Low)
    Elsif close < candleLow[1] then
    Drawarrowdown(Barindex, High)
    Endif
    
    Endif
    
    else
    insideCandles = insideCandles + 1
    
    if insideCandles >= (minLemgth) then
    
    OnlyLastRange = 2 //Pour afficher le range en cours et celui d'avant
    
    If $RangeStart[RangeIndex] = breakindex then
    $RangeLength[RangeIndex] = insideCandles
    $RangeHigh[RangeIndex] = candleHigh
    $RangeLow[RangeIndex] = candleLow
    Else
    RangeIndex = RangeIndex + 1
    $RangeStart[RangeIndex] = breakindex
    $RangeLength[RangeIndex] = insideCandles
    $RangeHigh[RangeIndex] = candleHigh
    $RangeLow[RangeIndex] = candleLow
    Endif
    
    // Dernier rectangle (violet)
    drawsegment(breakindex, candleHigh, barindex+1, candleHigh) style(dottedline1,3) coloured(255,79,255,255)
    drawsegment(breakindex, candleLow, barindex+1, candleLow) style(dottedline1,3) coloured(255,79,255,255)
    DRAWRECTANGLE(breakindex, candleHigh, barindex+1, candleLow) coloured(255,79,255,20) bordercolor(255,79,255,200)
    drawsegment(breakindex, (candleHigh+candleLow)/2, barindex+1, (candleHigh+candleLow)/2) style(dottedline1,3) coloured(255,79,255,255)
    
    else
    OnlyLastRange = 1 //Pour afficher le range en cours et celui d'avant
    endif
    endif
    
    Fin = Max(0, RangeIndex - ($RangeStart[RangeIndex] = breakindex))
    
    If OnlyLastRange > 0 then
    Debut = Max(0, Fin - OnlyLastRange + 1 + ($RangeStart[RangeIndex] = breakindex))
    Else
    Debut = 0
    Endif
    
    If RangeIndex > 1 then
    For i = Debut to Fin do
    
    // Précédents rectangles (vert/jaune)
    drawsegment($RangeStart[i], $RangeHigh[i], $RangeStart[i]+$RangeLength[i], $RangeHigh[i]) style(line,3) coloured(198,255,0,255)
    drawsegment($RangeStart[i], $RangeLow[i], $RangeStart[i]+$RangeLength[i], $RangeLow[i]) style(line,3) coloured(198,255,0,255)
    DRAWRECTANGLE($RangeStart[i], $RangeHigh[i], $RangeStart[i]+$RangeLength[i], $RangeLow[i]) coloured(198,255,0,20) bordercolor(198,255,0,200)
    drawsegment($RangeStart[i], ($RangeHigh[i]+$RangeLow[i])/2, $RangeStart[i]+$RangeLength[i], ($RangeHigh[i]+$RangeLow[i])/2) style(dottedline1,3) coloured(198,255,0,255)
    
    Next
    Endif
    
    return
    Il suffit de rajouter les lignes : 90, 110 et 111 (Ne pas oublier de mettre les paramètres à commentaire)
    Iván González and robertogozzi thanked this post
    #254388 quote
    Med5
    Participant
    New
    Merci , oui ce code affiche que deux ranges, mais vous voulez dire quoi par ” Ne pas oublier de mettre les paramètres à commentaire)” ? merci
    #254398 quote
    LucasBest
    Participant
    Junior
    //Paramètres à mettre en commentaire (car déjà définis dans la configuration) once f=0 once filteringmethod = 1 once filtre = 0 once minLemgth = 15 // => cette partie du code peut être enlevée
    Iván González and Med5 thanked this post
    #254425 quote
    Med5
    Participant
    New
    Vraiment top merci Par contre, je l’utilise en multi-timeframe et ça rame pas mal, même en affichant seulement les deux ranges, ça reste lourd. Tu aurais une astuce pour le rendre encore plus léger, s’il te plaît ? Merci d’avance pour l’aide ! 🙏
    #254432 quote
    LaMaille
    Participant
    Junior
    Tout dépend de quelles options tu as besoin ? Est ce que filtre est à 0/Non ou 1/oui?
    #254450 quote
    Med5
    Participant
    New
    Merci pour ta réponse Pour clarifier : je n’utilise aucun filtre Le code fonctionne bien et affiche uniquement deux ranges mais en multi-timeframe il reste quand même assez lourd et fait ramer l’affichage. Je cherche donc simplement une solution pour l’alléger, sans changer la logique de détection actuelle, juste optimiser la partie affichage. Merci d’avance si tu as une idée ! 🙏
    #254466 quote
    LucasBest
    Participant
    Junior
    Je ne pense pas que ce soit l’affichage de 2 rectangles et 6 segments qui fasse ramer le code… Comment l’utilises tu en multi timeframe ? Si l’on veut accélérer le code, on peut enlever toute la partie filtre (s’il n’est pas utilisé) et on peut aussi se passer de tableau dans la mesure où seulement 1 ou 2 ranges sont nécessaires…
    Med5 thanked this post
    #254468 quote
    Med5
    Participant
    New
    J’ai enlevé toute la partie filtres + les tableaux, et je garde seulement 2 ranges : le violet actuel et le dernier cassé en vert. beaucoup plus léger même en multi-timeframe (1 min → 4h). Merci pour l’aide !
    #254473 quote
    LucasBest
    Participant
    Junior
    Est-ce plus rapide comme cela?
    DefParam DrawOnLastBarOnly = true
    
    once CandleLow = low
    once CandleHigh = high
    once InsideCandles = 1
    once Breakindex = Barindex
    
    once PrevCandleLow = low
    once PrevCandleHigh = high
    once PrevInsideCandles = 1
    once PrevStartindex = 0
    once PrevEndindex = 0
    
    If Breakindex < Barindex then
    
    BreakoutCandle = close > candleHigh[1] or close < candleLow[1]
    
    If BreakoutCandle then
    
    if InsideCandles >= minLemgth then
    
    If close > CandleHigh[1] then
    Drawarrowup(Barindex, Low)
    Elsif close < CandleLow[1] then
    Drawarrowdown(Barindex, High)
    Endif
    
    PrevCandleLow = CandleLow
    PrevCandleHigh = CandleHigh
    PrevInsideCandles = InsideCandles
    PrevStartindex = Breakindex
    PrevEndindex = Barindex
    PrevCandleMiddle = CandleMiddle
    
    Endif
    
    CandleLow = low
    CandleHigh = high
    InsideCandles = 1
    Breakindex = barindex
    
    Else
    
    if high > candleHigh[1] and close <= candleHigh[1] then
    candleHigh = high
    endif
    
    if low < candleLow[1] and close >= candleLow[1] then
    candleLow = low
    endif
    
    CandleMiddle = (candleHigh + candleLow)/2
    insideCandles = insideCandles+1
    
    if insideCandles >= minLemgth then
    
    drawsegment(breakindex,candleHigh,barindex+1,candleHigh)style(dottedline1,2)coloured("orange",255)
    drawsegment(breakindex,candlelow,barindex+1,candlelow)style(dottedline1,2)coloured("orange",255)
    DRAWRECTANGLE(breakindex,candleHigh,barindex+1,candlelow)coloured("orange",20)bordercolor("orange",100)
    drawsegment(breakindex,CandleMiddle,barindex+1,CandleMiddle)style(dottedline1,2)coloured("orange",255)
    
    endif
    Endif
    Endif
    
    If PrevStartindex > 0 then
    
    drawsegment(PrevStartindex,PrevCandleHigh,PrevEndindex,PrevCandleHigh)style(line,2)coloured("blue",255)
    drawsegment(PrevStartindex,PrevCandlelow,PrevEndindex,PrevCandlelow)style(line,2)coloured("blue",255)
    DRAWRECTANGLE(PrevStartindex,PrevCandleHigh,PrevEndindex,PrevCandlelow)coloured("grey",20)bordercolor("grey",100)
    drawsegment(PrevStartindex,PrevCandleMiddle,PrevEndindex,PrevCandleMiddle)style(dottedline1,2)coloured("blue",255)
    
    Endif
    
    return
    
    Med5 thanked this post
    #254474 quote
    LucasBest
    Participant
    Junior
    J’avais aussi créé une version MTF…
    DefParam DrawOnLastBarOnly = true
    
    Timeframe(240 minutes,updateonclose)
    
    BarInd2H = Barindex
    
    Close2H = Close
    
    once RangeLow2H = low
    once RangeHigh2H = high
    once insideCandles2H = 1
    once RangeIndex2H = 0
    
    MyTR2H = max(Range,max(abs(high - close[1]),abs(low - close[1])))
    
    if high > RangeHigh2H[1] and close <= RangeHigh2H[1] then
    RangeHigh2H = high
    endif
    
    if low < RangeLow2H[1] and close >= RangeLow2H[1] then
    RangeLow2H = low
    endif
    
    breakoutCandle2H = close > RangeHigh2H or close < RangeLow2H
    bullishBreak2H = close > RangeHigh2H[1] and insideCandles2H[1] >= (minLength2H+1)
    bearishBreak2H = close < RangeLow2H[1] and insideCandles2H[1] >= (minLength2H+1)
    
    RangeMiddle2H = (RangeHigh2H + RangeLow2H)/2
    
    FiltreBreakoutCandle2H = (Average[2](MyTR2H[0])>F2H*Average[20](MyTR2H[1]) and StartIndex2H>=BarInd2H-1)
    
    if breakoutCandle2H or (filtre2H and FiltreBreakoutCandle2H) then //(Average[2](MyTR[0])>F*Average[20](MyTR[1]) and StartIndex>=BarInd2H-1)) then
    RangeLow2H = low
    RangeHigh2H = high
    insideCandles2H = 1
    StartIndex2H = BarInd2H
    
    If insideCandles2H[1] >= (minLength2H) and insideCandles2H = 1 then //and $RangeStart[RangeIndex] = StartIndex[1] then
    If close > RangeHigh2H[1] then
    Drawarrowup(BarInd2H,RangeLow2H[1]) coloured("darkturquoise",255)
    Elsif close < RangeLow[1] then
    Drawarrowdown(BarInd2H,RangeHigh2H[1]) coloured("deeppink",255)
    Endif
    
    Endif
    
    else
    insideCandles2H = insideCandles2H+1
    
    if insideCandles2H >= (minLength2H) then
    
    If $RangeStart2H[RangeIndex2H] = StartIndex2H then
    $RangeFinish2H[RangeIndex2H] = StartIndex2H+insideCandles2H
    $RangeHigh2H[RangeIndex2H] = RangeHigh2H
    $RangeLow2H[RangeIndex2H] = RangeLow2H
    Else
    RangeIndex2H = RangeIndex2H + 1
    $RangeStart2H[RangeIndex2H] = StartIndex2H
    $RangeFinish2H[RangeIndex2H] = StartIndex2H+insideCandles2H
    $RangeHigh2H[RangeIndex2H] = RangeHigh2H
    $RangeLow2H[RangeIndex2H] = RangeLow2H
    Endif
    
    drawsegment(StartIndex2H,RangeHigh2H,BarInd2H+1,RangeHigh2H)style(dottedline1,2)coloured("orange",255)
    drawsegment(StartIndex2H,RangeLow2H,BarInd2H+1,RangeLow2H)style(dottedline1,2)coloured("orange",255)
    DRAWRECTANGLE(StartIndex2H,RangeHigh2H,BarInd2H+1,RangeLow2H)coloured("orange",20)bordercolor("orange",100)
    drawsegment(StartIndex2H,(RangeHigh2H+RangeLow2H)/2,BarInd2H+1,(RangeHigh2H+RangeLow2H)/2)style(dottedline1,2)coloured("orange",255)
    
    endif
    endif
    
    Fin2H = Max(0,RangeIndex2H-($RangeStart2H[RangeIndex2H]=StartIndex2H))
    
    If OnlyLastRange2H > 0 then
    Debut2H = Max(0,Fin2H-OnlyLastRange2H+1+($RangeStart2H[RangeIndex2H]=StartIndex2H))
    Else
    Debut2H = 0
    Endif
    
    /////////////////////////////////////////////////////////////////
    
    Timeframe(default)
    
    once config = 0
    
    once RangeLow = low
    once RangeHigh = high
    once insideCandles = 1
    once RangeIndex = 0
    
    MyTR = max(Range,max(abs(high - close[1]),abs(low - close[1])))
    
    if high > RangeHigh[1] and close <= RangeHigh[1] then
    RangeHigh = high
    endif
    
    if low < RangeLow[1] and close >= RangeLow[1] then
    RangeLow = low
    endif
    
    breakoutCandle = close > RangeHigh or close < RangeLow
    bullishBreak = close > RangeHigh[1] and insideCandles[1] >= (minLength+1)
    bearishBreak = close < RangeLow[1] and insideCandles[1] >= (minLength+1)
    
    RangeMiddle = (RangeHigh + RangeLow)/2
    
    FiltreBreakoutCandle1 = (Average[2](MyTR[0])>F*Average[20](MyTR[1]) and StartIndex>=BarInd2H-1)
    
    if breakoutCandle or (filtre and FiltreBreakoutCandle1) then //(Average[2](MyTR[0])>F*Average[20](MyTR[1]) and StartIndex>=BarInd2H-1)) then
    RangeLow = low
    RangeHigh = high
    insideCandles = 1
    StartIndex = barindex
    
    If insideCandles[1] >= (minLength) and insideCandles = 1 then //and $RangeStart[RangeIndex] = StartIndex[1] then
    If close > RangeHigh[1] then
    Drawarrowup(Barindex,RangeLow) coloured("darkturquoise",255)
    Elsif close < RangeLow[1] then
    Drawarrowdown(Barindex,RangeHigh) coloured("deeppink",255)
    Endif
    
    Endif
    
    else
    insideCandles = insideCandles+1
    
    if insideCandles >= (minLength) then
    
    If $RangeStart[RangeIndex] = StartIndex then
    $RangeFinish[RangeIndex] = StartIndex+insideCandles
    $RangeHigh[RangeIndex] = RangeHigh
    $RangeLow[RangeIndex] = RangeLow
    Else
    RangeIndex = RangeIndex + 1
    $RangeStart[RangeIndex] = StartIndex
    $RangeFinish[RangeIndex] = StartIndex+insideCandles
    $RangeHigh[RangeIndex] = RangeHigh
    $RangeLow[RangeIndex] = RangeLow
    Endif
    
    drawsegment(StartIndex,RangeHigh,barindex+1,RangeHigh)style(dottedline1,2)coloured("orange",255)
    drawsegment(StartIndex,RangeLow,barindex+1,RangeLow)style(dottedline1,2)coloured("orange",255)
    DRAWRECTANGLE(StartIndex,RangeHigh,barindex+1,RangeLow)coloured("orange",20)bordercolor("orange",100)
    drawsegment(StartIndex,(RangeHigh+RangeLow)/2,barindex+1,(RangeHigh+RangeLow)/2)style(dottedline1,2)coloured("orange",255)
    
    endif
    endif
    
    Fin = Max(0,RangeIndex-($RangeStart[RangeIndex]=StartIndex))
    
    If OnlyLastRange > 0 then
    Debut = Max(0,Fin-OnlyLastRange+1+($RangeStart[RangeIndex]=StartIndex))
    Else
    Debut = 0
    Endif
    
    If RangeIndex > 1 then
    For i = Debut to Fin do
    drawsegment($RangeStart[i],$RangeHigh[i],$RangeFinish[i],$RangeHigh[i])style(line,2)coloured("blue",255)
    drawsegment($RangeStart[i],$RangeLow[i],$RangeFinish[i],$RangeLow[i])style(line,2)coloured("blue",255)
    DRAWRECTANGLE($RangeStart[i],$RangeHigh[i],$RangeFinish[i],$RangeLow[i])coloured("grey",20)bordercolor(204,0,0,1)
    drawsegment($RangeStart[i],($RangeHigh[i]+$RangeLow[i])/2,$RangeFinish[i],($RangeHigh[i]+$RangeLow[i])/2)style(dottedline1,2)coloured("blue",255)
    Lastclose = close[Barindex-($RangeFinish[i])]
    If Lastclose > $RangeHigh[i] then
    Drawarrowup($RangeFinish[i],$RangeLow[i]) coloured("darkturquoise",255)
    Else
    Drawarrowdown($RangeFinish[i],$RangeHigh[i]) coloured("deeppink",255)
    Endif
    Next
    Endif
    
    IF BarInd2H > 0 and BarInd2H <> BarInd2H[1] THEN
    
    If config = 0 and BarInd2H > 0 then
    For k = 0 to BarInd2H-1 do
    $BarBegin[k] = 0
    $BarEnd[k] = Barindex
    Next
    config = 1
    Endif
     
    $BarBegin[BarInd2H] = $BarEnd[BarInd2H-1]+1
    $BarEnd[BarInd2H] = Barindex
    
    Endif
    
    if insideCandles2H >= (minLength2H) then
    
    drawsegment($BarBegin[StartIndex2H],RangeHigh2H,BarIndex+1,RangeHigh2H)style(dottedline1,2)coloured("peru",255)
    drawsegment($BarBegin[StartIndex2H],RangeLow2H,BarIndex+1,RangeLow2H)style(dottedline1,2)coloured("peru",255)
    DRAWRECTANGLE($BarBegin[StartIndex2H],RangeHigh2H,BarIndex+1,RangeLow2H)coloured("peru",10)bordercolor("peru",10)
    drawsegment($BarBegin[StartIndex2H],(RangeHigh2H+RangeLow2H)/2,BarIndex+1,(RangeHigh2H+RangeLow2H)/2)style(dottedline1,2)coloured("peru",255)
    
    endif
    
    If Debut2H >= 0 then
    For i = Debut2H to Fin2H do
    If $RangeStart2H[i]>=2 then
    Start=abs(round($RangeStart2H[i]))
    Finish=abs(round($RangeFinish2H[i]))
    drawsegment($BarBegin[Start],$RangeHigh2H[i],$BarEnd[Finish],$RangeHigh2H[i])style(line,2)coloured("black",255)
    drawsegment($BarBegin[Start],$RangeLow2H[i],$BarEnd[Finish],$RangeLow2H[i])style(line,2)coloured("black",255)
    DRAWRECTANGLE($BarBegin[Start],$RangeHigh2H[i],$BarEnd[Finish],$RangeLow2H[i])coloured("black",10)bordercolor(204,0,0,1)
    drawsegment($BarBegin[Start],($RangeHigh2H[i]+$RangeLow2H[i])/2,$BarEnd[Finish],($RangeHigh2H[i]+$RangeLow2H[i])/2)style(dottedline1,2)coloured("black",255)
    /*Lastclose2H = Close2H[BarInd2H-Finish]
    If Lastclose2H > $RangeHigh2H[i] then
    Drawarrowup($BarEnd[Finish],$RangeLow2H[i]) coloured("darkturquoise",255)
    Else
    Drawarrowdown($BarEnd[Finish],$RangeHigh2H[i]) coloured("deeppink",255)
    Endif*/
    /*Test1 = $RangeStart2H[i]
    Test2 = $RangeFinish2H[i]
    Test3 = Lastset($BarBegin)
    Test4 = Lastset($Barend)
    */
    Endif
    Next
    Endif
    
    Return
    
    Med5 thanked this post
    #254481 quote
    Med5
    Participant
    New
    merci beaucoup @LucasBest c’est le top
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.

Optimisation affichage des ranges


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Med5 @adilmed10 Participant
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by Med5
1 month, 3 weeks ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 12/08/2025
Status: Active
Attachments: 2 files
Logo Logo
Loading...