parametrer les FVG
Forums › ProRealTime forum Français › Support plateforme ProRealTime › parametrer les FVG
- This topic has 18 replies, 3 voices, and was last updated 3 minutes ago by
JS.
-
-
04/19/2025 at 10:01 AM #246091
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))04/19/2025 at 1:18 PM #246096pas testé
1234567891011121314151617181920212223242526//@version=5//indicator(“Fair Value Gap (FVG)”, overlay=true)// ParamètresfvgLookback = 1// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[-fvgLookback]nextLow = low[-fvgLookback]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsif bullishFVG thenDRAWRECTANGLE(barindex – fvgLookback,prevHigh,barindex+ fvgLookback, low) COLOURED("green")endifif bearishFVG thenDRAWRECTANGLE(barindex – fvgLookback,high,barindex+ fvgLookback, prevLow) COLOURED("red")endifreturn04/19/2025 at 4:33 PM #24609704/19/2025 at 4:40 PM #24609804/19/2025 at 5:50 PM #246099Fair Value Gap1234567891011121314151617181920212223242526//@version=5//indicator("Fair Value Gap (FVG)", overlay=true)// ParametersfvgLookback = 1//input.int(1, title="Lookback (candle before and after)", minval=1)// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[0]nextLow = low[0]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsIf bullishFVG thenDrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured("Green",255)FillColor(0,50,0)EndIfIf bearishFVG thenDrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)EndIfReturn04/19/2025 at 6:01 PM #246101fvgLookback=2
Fair Value Gap 21234567891011121314151617181920212223242526//@version=5//indicator("Fair Value Gap (FVG)", overlay=true)// ParametersfvgLookback = 2//input.int(1, title="Lookback (candle before and after)", minval=1)// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[0]nextLow = low[0]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsIf bullishFVG thenDrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured("Green",255)FillColor(0,50,0)EndIfIf bearishFVG thenDrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)EndIfReturn04/19/2025 at 6:01 PM #246103Jai 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 004/19/2025 at 6:04 PM #24610404/19/2025 at 6:10 PM #24610504/19/2025 at 6:18 PM #24610604/19/2025 at 6:31 PM #246107FVG + Median123456789101112131415161718192021222324252627282930//@version=5//indicator("Fair Value Gap (FVG)", overlay=true)// ParametersfvgLookback = 2//input.int(1, title="Lookback (candle before and after)", minval=1)// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[0]nextLow = low[0]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsIf bullishFVG thenDrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured("Green",255)FillColor(0,50,0)Median=prevHigh+(Low-prevHigh)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")EndIfIf bearishFVG thenDrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)Median=High+(prevLow-High)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")EndIfReturn04/19/2025 at 6:32 PM #24610904/19/2025 at 6:43 PM #246111FVG +Median + Text1234567891011121314151617181920212223242526272829303132//@version=5//indicator("Fair Value Gap (FVG)", overlay=true)// ParametersfvgLookback = 2//input.int(1, title="Lookback (candle before and after)", minval=1)// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[0]nextLow = low[0]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsIf bullishFVG thenDrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured("Green",255)FillColor(0,50,0)Median=prevHigh+(Low-prevHigh)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")DrawText("#Median#",BarIndex-1,Median)EndIfIf bearishFVG thenDrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)Median=High+(prevLow-High)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")DrawText("#Median#",BarIndex-1,Median)EndIfReturn04/19/2025 at 6:54 PM #24611304/19/2025 at 7:00 PM #246115FVG + Media + BoldText1234567891011121314151617181920212223242526272829303132//@version=5//indicator("Fair Value Gap (FVG)", overlay=true)// ParametersfvgLookback = 2//input.int(1, title="Lookback (candle before and after)", minval=1)// Données des bougiesprevHigh = high[fvgLookback]prevLow = low[fvgLookback]nextHigh = high[0]nextLow = low[0]// Calcul du FVGbullishFVG = low > prevHighbearishFVG = high < prevLow// Affichage des FVGsIf bullishFVG thenDrawRectangle((BarIndex-fvgLookback),prevHigh,BarIndex,low)Coloured("Green",255)FillColor(0,50,0)Median=prevHigh+(Low-prevHigh)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Green")DrawText("#Median#",BarIndex-1,Median,SansSerif,Bold,16)EndIfIf bearishFVG thenDrawRectangle(BarIndex,High,(BarIndex-fvgLookback),prevLow)Coloured("Red",255)FillColor(50,0,0)Median=High+(prevLow-High)/2DrawSegment(BarIndex-fvgLookback,Median,BarIndex,Median)Coloured("Red")DrawText("#Median#",BarIndex-1,Median,SansSerif,Bold,16)EndIfReturn -
AuthorPosts