parametrer les FVG

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #246091 quote
    geronimangeroniman
    Participant
    Average

    qui pourrait transcrire ce programme de détection des FVG de Tradingview? merci d’avance.

     

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

    // Paramètres
    fvgLookback = input.int(1, title=”Lookback (bougie avant et après)”, minval=1)

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

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

    // Affichage des FVGs
    if bullishFVG
    box.new(bar_index – fvgLookback, prevHigh, bar_index + fvgLookback, low, border_color=color.green, bgcolor=color.new(color.green, 85))

    if bearishFVG
    box.ew(bar_index – fvgLookback, high, bar_index + fvgLookback, prevLow, border_color=color.red, bgcolor=color.new(color.red, 85))

    #246096 quote
    fifi743fifi743
    Participant
    Master

    pas testé

     

    //@version=5
    //indicator(“Fair Value Gap (FVG)”, overlay=true)
    
    // Paramètres
    fvgLookback = 1
    
    // Données des bougies
    prevHigh = high[fvgLookback]
    prevLow = low[fvgLookback]
    nextHigh = high[-fvgLookback]
    nextLow = low[-fvgLookback]
    
    // Calcul du FVG
    bullishFVG = low > prevHigh
    bearishFVG = high < prevLow
    
    // Affichage des FVGs
    if bullishFVG then
    DRAWRECTANGLE(barindex – fvgLookback,prevHigh,barindex+ fvgLookback, low) COLOURED("green")
    endif
    
    if bearishFVG then
    
    DRAWRECTANGLE(barindex – fvgLookback,high,barindex+ fvgLookback, prevLow) COLOURED("red")
    endif
    return
    #246097 quote
    geronimangeroniman
    Participant
    Average

    Merci bien mais en effet les FVG ne s’affichent pas

    #246098 quote
    geronimangeroniman
    Participant
    Average

    en fait ce programme affiche les gaps mais pas les FVG

    #246099 quote
    JSJS
    Participant
    Master
    //@version=5
    //indicator("Fair Value Gap (FVG)", overlay=true)
    
    // Parameters
    fvgLookback = 1//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("Green",255)FillColor(0,50,0)
    EndIf
    
    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)
    EndIf
    
    Return
    Scherm­afbeelding-2025-04-19-om-18.50.04.png Scherm­afbeelding-2025-04-19-om-18.50.04.png
    #246101 quote
    JSJS
    Participant
    Master

    fvgLookback=2

    //@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("Green",255)FillColor(0,50,0)
    EndIf
    
    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)
    EndIf
    
    Return
    Scherm­afbeelding-2025-04-19-om-19.01.10.png Scherm­afbeelding-2025-04-19-om-19.01.10.png
    #246103 quote
    geronimangeroniman
    Participant
    Average

    Jai demandé à chatgpt de programmer un FVG mais il affiche une erreur

     

    // Indicateur Fair Value Gap (FVG) pour ProRealTime
    // Détection des zones de déséquilibre haussier et baissier

    // Paramètres configurables
    DEFPARAM CumulateOrders = False // Ne pas cumuler les ordres pour éviter les conflits
    RangeThreshold = 0.001 // Seuil minimum pour la taille du gap (ajustable selon l’instrument)
    ExtendBars = 100 // Nombre de barres pour étendre les rectangles à droite

    // Variables pour stocker les niveaux du FVG
    fvgUpTop = 0
    fvgUpBottom = 0
    fvgDownTop = 0
    fvgDownBottom = 0

    // Conditions pour un FVG haussier
    // Un FVG haussier se forme quand le bas de la bougie actuelle est supérieur au haut de la bougie d’il y a deux barres
    IF Low > High[2] THEN
    fvgUpTop = Low // Haut du FVG haussier
    fvgUpBottom = High[2] // Bas du FVG haussier
    // Vérifier si la taille du gap est significative
    IF (fvgUpTop – fvgUpBottom) / fvgUpBottom > RangeThreshold THEN
    // Dessiner un rectangle pour le FVG haussier
    DRAWRECTANGLE(fvgUpBottom, BarIndex, fvgUpTop, BarIndex + ExtendBars) COLOURED(0, 255, 0, 20) BORDERCOLOUR(0, 255, 0)
    ENDIF
    ENDIF

    // Conditions pour un FVG baissier
    // Un FVG baissier se forme quand le haut de la bougie actuelle est inférieur au bas de la bougie d’il y a deux barres
    IF High < Low[2] THEN
    fvgDownTop = Low[2] // Haut du FVG baissier
    fvgDownBottom = High // Bas du FVG baissier
    // Vérifier si la taille du gap est significative
    IF (fvgDownTop – fvgDownBottom) / fvgDownTop > RangeThreshold THEN
    // Dessiner un rectangle pour le FVG baissier
    DRAWRECTANGLE(fvgDownBottom, BarIndex, fvgDownTop, BarIndex + ExtendBars) COLOURED(255, 0, 0, 20) BORDERCOLOUR(255, 0, 0)
    ENDIF
    ENDIF

    // Retourner 0 pour éviter les erreurs
    RETURN 0

    #246104 quote
    geronimangeroniman
    Participant
    Average

    super merci JS

    JS thanked this post
    #246105 quote
    geronimangeroniman
    Participant
    Average

    JS est ce possible de rajouter un trait à 50% du FVG?

    #246106 quote
    JSJS
    Participant
    Master

    Dans la première ou la deuxième version ?
    Une ligne horizontale dans la « Box » ou une ligne qui continue vers « Gauche et/ou Droite » ?

    #246107 quote
    JSJS
    Participant
    Master
    //@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("Green",255)FillColor(0,50,0)
    Median=prevHigh+(Low-prevHigh)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")
    EndIf
    
    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)
    Median=High+(prevLow-High)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")
    EndIf
    
    Return
    Scherm­afbeelding-2025-04-19-om-19.31.30.png Scherm­afbeelding-2025-04-19-om-19.31.30.png
    #246109 quote
    geronimangeroniman
    Participant
    Average

    un trait avec le niveau de prix comme sur le chart ci joint , ça serait fantastique

    ESXXXX-2-minutes.png ESXXXX-2-minutes.png
    #246111 quote
    JSJS
    Participant
    Master
    //@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("Green",255)FillColor(0,50,0)
    Median=prevHigh+(Low-prevHigh)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")
    DrawText("#Median#",BarIndex-1,Median)
    EndIf
    
    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)
    Median=High+(prevLow-High)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")
    DrawText("#Median#",BarIndex-1,Median)
    EndIf
    
    Return
    Scherm­afbeelding-2025-04-19-om-19.43.29.png Scherm­afbeelding-2025-04-19-om-19.43.29.png
    #246113 quote
    geronimangeroniman
    Participant
    Average

    super merci, j ai mis les FVG en bleu pour bien voir le texte “median”. est ce possible de le mettre en “bold” pour que ce niveau de prix soit bien visible?

    ESXXXX-2-minutes-1.png ESXXXX-2-minutes-1.png
    #246115 quote
    JSJS
    Participant
    Master
    //@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("Green",255)FillColor(0,50,0)
    Median=prevHigh+(Low-prevHigh)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")
    DrawText("#Median#",BarIndex-1,Median,SansSerif,Bold,16)
    EndIf
    
    If bearishFVG then
    DrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)
    Median=High+(prevLow-High)/2
    DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")
    DrawText("#Median#",BarIndex-1,Median,SansSerif,Bold,16)
    EndIf
    
    Return
    Iván González thanked this post
    Scherm­afbeelding-2025-04-19-om-19.59.53.png Scherm­afbeelding-2025-04-19-om-19.59.53.png
Viewing 15 posts - 1 through 15 (of 24 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

parametrer les FVG


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
geroniman @geroniman Participant
Summary

This topic contains 23 replies,
has 3 voices, and was last updated by geronimangeroniman
1 year, 4 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/19/2025
Status: Active
Attachments: 10 files
ProRealCode ProRealCode
Loading...