Fair Gap Value
Forums › ProRealTime forum Français › Support ProBuilder › Fair Gap Value
- This topic has 2 replies, 2 voices, and was last updated 1 week ago by
Philippe.
-
-
08/14/2025 at 9:36 AM #249717
Bonjour à tous,
J’essaie en vain de coder un FGV sur 3 bougies et de me les afficher tous tant qu’ils ne sont pas comblés.
J’ai de code qui ne m’affiche rien du tout :
// ———- Paramètres ———-
MinGapPts = 1
ExtendBars = 30 // si ExtendUntilFill = 0
ExtendUntilFill = 1 // 1 = rectangle disparaît quand combléminGap = MinGapPts * pointsize
// ———- Etats persistants ———-
ONCE bullActive = 0
ONCE bearActive = 0ONCE bullTop = 0.0
ONCE bullBot = 0.0
ONCE bearTop = 0.0
ONCE bearBot = 0.0ONCE bullStart = 0
ONCE bearStart = 0// ———- Détection ———-
bullCond = (low > high[2]) AND (low – high[2] >= minGap)
bearCond = (high < low[2]) AND (low[2] – high >= minGap)IF bullCond THEN
bullTop = high[2] // haut du rectangle = high de la 1ère bougie
bullBot = low[0] // bas du rectangle = low de la 3ème bougie
bullStart = barindex
bullActive = 1
ENDIFIF bearCond THEN
bearTop = high[0] // haut du rectangle = high de la 3ème bougie
bearBot = low[2] // bas du rectangle = low de la 1ère bougie
bearStart = barindex
bearActive = 1
ENDIF// ———- Gestion persistance ———-
IF ExtendUntilFill = 1 THEN
IF bullActive = 1 AND low <= bullBot THEN
bullActive = 0
ENDIF
IF bearActive = 1 AND high >= bearTop THEN
bearActive = 0
ENDIF
ENDIF// ———- Dessin ———-
IF bullActive = 1 THEN
bullEnd = barindex
IF ExtendUntilFill = 0 THEN
bullEnd = bullStart + ExtendBars
IF barindex > bullEnd THEN
bullActive = 0
ENDIF
ENDIF
IF bullEnd <= bullStart THEN
bullEnd = bullStart + 1
ENDIF
DRAWRECTANGLE(bullStart, bullTop, bullEnd, bullBot) COLOURED(0,180,0,60)
ENDIFIF bearActive = 1 THEN
bearEnd = barindex
IF ExtendUntilFill = 0 THEN
bearEnd = bearStart + ExtendBars
IF barindex > bearEnd THEN
bearActive = 0
ENDIF
ENDIF
IF bearEnd <= bearStart THEN
bearEnd = bearStart + 1
ENDIF
DRAWRECTANGLE(bearStart, bearTop, bearEnd, bearBot) COLOURED(220,0,0,60)
ENDIF// ———- Séries pour RETURN ———-
bullTopPlot = undefined
bullBotPlot = undefined
bearTopPlot = undefined
bearBotPlot = undefinedIF bullActive = 1 THEN
bullTopPlot = bullTop
bullBotPlot = bullBot
ENDIF
IF bearActive = 1 THEN
bearTopPlot = bearTop
bearBotPlot = bearBot
ENDIFRETURN bullTopPlot AS “FVG+ Haut”, bullBotPlot AS “FVG+ Bas”, bearTopPlot AS “FVG- Haut”, bearBotPlot AS “FVG- Bas”
Avez-vous une idée ?
Merci par avance,
Bien Cordialement,
08/17/2025 at 11:39 AM #249827Votre code:
123456789// ———- Gestion persistance ———-IF ExtendUntilFill = 1 THENIF bullActive = 1 AND low <= bullBot THENbullActive = 0ENDIFIF bearActive = 1 AND high >= bearTop THENbearActive = 0ENDIFENDIFIl faut le changer comme ceci, sans le symbole “=” :
123456789// ———- Gestion persistance ———-IF ExtendUntilFill = 1 THENIF bullActive = 1 AND low < bullBot THENbullActive = 0ENDIFIF bearActive = 1 AND high > bearTop THENbearActive = 0ENDIFENDIFou changez-le comme ceci, si vous préférez utiliser “=”, indiquez simplement que la vérification doit être effectuée dans la barre suivante :
123456789// ———- Gestion persistance ———-IF ExtendUntilFill = 1 THENIF bullActive = 1 AND low <= bullBot AND BarIndex > bullStart THENbullActive = 0ENDIFIF bearActive = 1 AND high >= bearTop AND BarIndex > bearStart THENbearActive = 0ENDIFENDIFparce que LOW ou HIGH sont immédiatement égaux à leurs-même.
08/17/2025 at 11:57 AM #249828Merci
1 user thanked author for this post.
-
AuthorPosts