I am experiencing an issue where the redraw code in CheckFilledFVGs() reuses tags if two FVGs are closed by same candle. I modified the code to this to solve:
if (!HideFilledGaps)
{
Brush BorderBrush = fvg.type == FVGType.R ? DownBrush : UpBrush;
rect = Draw.Rectangle(this, "FILLED" + fvg.tag, false, fvg.gapStartTime, fvg.lowerPrice, Times[1][0], fvg.upperPrice, BorderBrush, FillBrush, FilledAreaOpacity, true);
rect.OutlineStroke.Opacity = Math.Min(100, FilledAreaOpacity * 4);
}
Set
private bool IsDebug = true;
and modify the debug statement to:
Debug("Drawing Up FVG [" + fvg.gapStartTime + ", " + fvg.upperPrice + ", " + future + ", " + fvg.lowerPrice + "]");
Might be worth changing to future to FVG bar plus number of days loaded on the chart. We could modify future before Drawing Recs:
Debug("Impulse move detected.");
future = Times[1][2].AddDays(ChartBars.Properties.DaysBack);
// Fair value gap while going UP
// Low[0] > High[2]
if (Lows[1][0] > Highs[1][2] && (Math.Abs(Lows[1][0] - Highs[1][2]) >= MinimumFVGSize))

Leave a comment: