modifier un FVG

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #250152 quote
    geronimangeroniman
    Participant
    Average

    bonjour voici 2 itf: un pour les FVG avec les 50% en pointillé qui sont tres souvent nettoyés, et un autre qui montre une ligne des 50% de chaque bougie. Elle disparait quand elle est touchée. Qui pourrait modifier le paarmetrage pour que les 50% du FVG affiche une ligne continue qui disaprait quand elle est touchée? Merci d’avance.

     

    50% de chaque bougie ————————————————————-

    defparam drawonlastbaronly=true

    Mid=low+(High-low)/2

    if(islastbarupdate) then
    lo=low[0]
    hi=high[0]

    for i=1 to 1000

    if (Mid[i]>hi or Mid[i]<lo) then
    DRAWRAY(barindex-i, Mid[i], barindex+5, Mid[i]) coloured(250,0,250)style(line, 1)
    endif
    lo=min(lo,low[i])
    hi=max(hi,high[i])
    next

    endif

    return Mid

     

     

    FVG ———————————————————–

    //@version=5
    //indicator(“Fair Value Gap (FVG)”, overlay=true)

    // Parameters
    fvgLookback = 2//input.int(1, title=”Lookback (candle before and after)”, minval=1)

    // Données des bougies
    prevHigh = high[fvgLookback]
    prevLow = low[fvgLookback]
    nextHigh = high[0]
    nextLow = low[0]

    // Calcul du FVG
    bullishFVG = low > prevHigh
    bearishFVG = high < prevLow

    // Affichage des FVGs
    If bullishFVG then
    DrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured(“grey”,155)FillColor(0,0,250)style(dottedline, 1)
    Median=prevHigh+(Low-prevHigh)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured(“yellow”)style(line, 2)
    //DrawText(“#Median#”,BarIndex-1,Median,dialog,bold,12)
    EndIf

    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured(“grey”,155)FillColor(0,0,250)style(dottedline, 1)
    Median=High+(prevLow-High)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured(“yellow”)style(line, 2)
    //DrawText(“#Median#”,BarIndex-1,Median,dialog,bold,12)
    EndIf

    Return

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

    voici

    ONCE fvgCounter = -1
    
    isBullishFVG = (low > high[2])
    isBearishFVG = (high < low[2])
    
    IF isBullishFVG OR isBearishFVG THEN
    fvgCounter = fvgCounter + 1
        
    $fvgStartBar[fvgCounter] = barindex - 1 
    $fvgEndBar[fvgCounter] = barindex
    $fvgTouched[fvgCounter] = 0 
        
    IF isBullishFVG THEN
    $fvgIsBearish[fvgCounter] = 0
    $fvgTop[fvgCounter] = low
    $fvgBottom[fvgCounter] = high[2]
    ELSE 
    $fvgIsBearish[fvgCounter] = 1
    $fvgTop[fvgCounter] = low[2]
    $fvgBottom[fvgCounter] = high
    ENDIF
        
    $fvgMedian[fvgCounter] = ($fvgTop[fvgCounter] + $fvgBottom[fvgCounter]) / 2
    ENDIF
    
    
    IF fvgCounter >= 0 and islastbarupdate THEN
    
    FOR i = 0 TO fvgCounter DO
    dist = barindex - $fvgEndBar[i]
    
    FOR j=dist downto 0 do
    if $fvgTouched[i] = 0 and high[j]>$fvgMedian[i] and low[j]<$fvgMedian[i] then
        $fvgTouched[i] = 1
        $fvgEndBar[i] = barindex[j]
    break
    endif    
    NEXT
       
    if $fvgTouched[i] = 1 then
    drawsegment($fvgStartBar[i],$fvgMedian[i],$fvgEndBar[i],$fvgMedian[i])style(dottedline)
    else
    drawsegment($fvgStartBar[i],$fvgMedian[i],barindex,     $fvgMedian[i])style(dottedline)
    endif
    
    if $fvgIsBearish[i] = 0 then
    DRAWRECTANGLE($fvgStartBar[i]-1, $fvgBottom[i], $fvgStartBar[i]+1, $fvgTop[i]) COLOURED(0,150,0,20) BORDERCOLOR(0,150,0)
    else
    DRAWRECTANGLE($fvgStartBar[i]-1, $fvgTop[i], $fvgStartBar[i]+1, $fvgBottom[i]) COLOURED(200,0,0,20) BORDERCOLOR(200,0,0)
    endif
    NEXT
    ENDIF
    
    RETURN
    
    robertogozzi thanked this post
    #250172 quote
    geronimangeroniman
    Participant
    Average

    Thanks Ivan

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

modifier un FVG


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
geroniman @geroniman Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by geronimangeroniman
1 year ago.

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