parametrer les FVG

  • This topic has 18 replies, 3 voices, and was last updated 1 hour ago by avatarJS.
Viewing 4 posts - 16 through 19 (of 19 total)
  • #246117
    JS
    #246119

    voila ça donne ça.

     

    //@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(“YELLOW”,255)FillColor(0,0,250)
    Median=prevHigh+(Low-prevHigh)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured(“BLACK”)
    DrawText(“#Median#”,BarIndex-1,Median,dialog,bold,15)
    EndIf

    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured(“YELLOW”,255)FillColor(0,0,250)
    Median=High+(prevLow-High)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured(“BLACK”)
    DrawText(“#Median#”,BarIndex-1,Median,dialog,bold,15)
    EndIf

    Return

    1 user thanked author for this post.
    avatar JS
    #246121

    Pour completer , l idée serait en effet de faire une extension à droite pour les 50% de FVG qui n’ont pas été atteint. Dés que le  niveaux est touché , il faudrait que le trait disparaisse.

    #246122
    JS

    Ce sera difficile, alors vous devrez travailler avec des « arrays »…
    Malheureusement, les « arrays » ne sont pas pour moi…

Viewing 4 posts - 16 through 19 (of 19 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login