Problème d’opacité Indicateur FVG (UT 5/15 min)
Forums › ProRealTime forum Français › Support ProBuilder › Problème d’opacité Indicateur FVG (UT 5/15 min)
- This topic has 2 replies, 2 voices, and was last updated 1 month ago by
AdilMed10.
-
-
06/05/2025 at 1:13 PM #247950
Bonjour,
J’utilise un indicateur FVG trouvé sur le forum ProRealCode. Il fonctionne bien, mais sur les graphiques 5 et 15-30 minutes (avec 15 000 bougies), j’ai un problème d’affichage :
Les rectangles FVG non mitigés s’empilent à chaque bougie
Même avec une opacité faible (ex : 20), le fond devient très sombre
Si je mets une durée fixe (ex : 50, 300, 999999), les FVG disparaissent ou ne s’affichent plus
J’ai essayé plusieurs solutions avec l’IA mais sans succès.
Je souhaiterais garder la logique actuelle du code, mais pouvoir afficher les FVG non mitigés sans effet de sur-opacité ni disparition des anciennes FVG
Pourriez-vous m’aider à corriger ce point tout en gardant la structure du code ?Merci d’avance,
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177//---------------------------------------------//// PRC_Fair Value Gap modifié (visuel optimisé)// Garde tous les FVG non mitigés visibles sans sur-opaquage//---------------------------------------------//thresholdPer = 0auto = 0dynamic = 0mitigationsLevels = 1//---------------------------------------------//// Threshold//---------------------------------------------//if barindex > 0 and auto thenthreshold = summation[barindex]((high - low) / low) / barindexelsethreshold = thresholdPer / 100endif//---------------------------------------------//// FVG Detection//---------------------------------------------//bullFvg = low > high[2] and close[1] > high[2] and (low - high[2]) / high[2] > thresholdbearFvg = high < low[2] and close[1] < low[2] and (low[2] - high) / high > thresholdif bullFvg thennewFvgmax = lownewFvgmin = high[2]newFvgisbull = 1newFvgx = barindexr = 8g = 153b = 129a = 0elsif bearFvg thennewFvgmax = low[2]newFvgmin = highnewFvgisbull = 0newFvgx = barindexr = 244g = 54b = 69a = 0elsea = 100endif//---------------------------------------------//// Anti-doublons//---------------------------------------------//alreadyExists = 0for j = 0 to z doif $newFvgx[j] = newFvgx thenalreadyExists = 1breakendifnext//---------------------------------------------//// Bull FVG//---------------------------------------------//if bullFvg and alreadyExists = 0 thenif dynamic thenmaxbullFvg = newFvgmaxminbullFvg = newFvgminendifif dynamic = 0 then$boxleft[z+1] = barindex[2]$boxrigth[z+1] = barindex // extensible$boxbot[z+1] = newFvgmin$boxTop[z+1] = newFvgmaxendif$newFvgmax[z+1] = newFvgmax$newFvgmin[z+1] = newFvgmin$newFvgisbull[z+1] = newFvgisbull$newFvgx[z+1] = newFvgxz = z + 1bullcount = bullcount + 1t = newFvgxelsif dynamic thenmaxBullFvg = max(min(close, maxBullFvg), minBullFvg)endif//---------------------------------------------//// Bear FVG//---------------------------------------------//if bearFvg and alreadyExists = 0 thenif dynamic thenmaxbearFvg = newFvgmaxminbearFvg = newFvgminendifif dynamic = 0 then$boxleft[z+1] = barindex[2]$boxrigth[z+1] = barindex$boxbot[z+1] = newFvgmin$boxTop[z+1] = newFvgmaxendif$newFvgmax[z+1] = newFvgmax$newFvgmin[z+1] = newFvgmin$newFvgisbull[z+1] = newFvgisbull$newFvgx[z+1] = newFvgxz = z + 1bearcount = bearcount + 1t = newFvgxelsif dynamic thenminBearFvg = min(max(close, minBearFvg), maxBearFvg)endif//---------------------------------------------//// Mitigated lines//---------------------------------------------//if z > 0 thenfor i = z - 1 downto 0 doif $newFvgisbull[i] = 1 and close < $newFvgmin[i] thenif dynamic = 0 then$boxleft[i] = undefined$boxrigth[i] = undefined$boxbot[i] = undefined$boxTop[i] = undefinedendif$newFvgmax[i] = undefined$newFvgmin[i] = undefined$newFvgisbull[i] = undefined$newFvgx[i] = undefinedbullMitigated = bullMitigated + 1elsif $newFvgisbull[i] = 0 and close > $newFvgmax[i] thenif dynamic = 0 then$boxleft[i] = undefined$boxrigth[i] = undefined$boxbot[i] = undefined$boxTop[i] = undefinedendif$newFvgmax[i] = undefined$newFvgmin[i] = undefined$newFvgisbull[i] = undefined$newFvgx[i] = undefinedbearMitigated = bearMitigated + 1endifnextendif//---------------------------------------------//// Unmitigated lines (visuel)//---------------------------------------------//if islastbarupdate and z > 0 and dynamic = 0 thenfor i = z downto 0 doif $boxleft[i] <> undefined thenif $boxrigth[i] < barindex then$boxrigth[i] = barindexendifif $newFvgisbull[i] = 1 thendrawrectangle($boxleft[i], $boxbot[i], $boxrigth[i], $boxTop[i]) fillcolor(128, 0, 0, 10) coloured(128, 0, 0, 10)elsedrawrectangle($boxleft[i], $boxbot[i], $boxrigth[i], $boxTop[i]) fillcolor(47, 79, 79, 10) coloured(47, 79, 79, 10)endifhauteur = $boxTop[i] - $boxbot[i]niv25 = $boxbot[i] + hauteur * 0.25niv50 = $boxbot[i] + hauteur * 0.5niv75 = $boxbot[i] + hauteur * 0.75drawsegment($boxleft[i], niv25, $boxrigth[i], niv25) coloured(0, 0, 0, 64)drawsegment($boxleft[i], niv50, $boxrigth[i], niv50) coloured(0, 0, 0, 64)drawsegment($boxleft[i], niv75, $boxrigth[i], niv75) coloured(0, 0, 0, 64)endifnextendif//---------------------------------------------//// Dynamic view (si activé)if dynamic thenif newFvgisbull thencolorbetween($newFvgmax[z], $newFvgmin[z], r, g, b, a)elsecolorbetween($newFvgmax[z], $newFvgmin[z], r, g, b, a)endifendif//---------------------------------------------//return06/06/2025 at 7:43 AM #247988Entrez dans la première ligne de code
defparam drawonlastbaronly=true
2 users thanked author for this post.
06/06/2025 at 9:50 AM #248003 -
AuthorPosts