I want to visually highlight a gap until it is filled. So far, I came up with the following code (see the attached screenshot for the result of this code). What I want to achieve is that the lines that indicate the gap reach until the candle that fully fills this gap (or else continue to go on until the gap is fully filled). How can this be done? So far I have hardcoded the length of the line to 10 bars; but that is obviously either too long or too short. Thank you so much for your help. Greetings! // Calculate average range AverageHIGH = AVERAGE[20](HIGH) AverageLOW = AVERAGE[20](LOW) AverageRANGE = AverageHIGH - AverageLOW // Find bullish gaps IF LOW > HIGH[1] AND (LOW - HIGH[1]) > 0.35 * AverageRANGE THEN gapfillzoneHIGH = LOW gapfillzoneLOW = HIGH[1] a = BARINDEX-1 DRAWSEGMENT(a,gapfillzoneHIGH,BARINDEX+10,gapfillzoneHIGH) COLOURED(0,255,0) DRAWSEGMENT(a,gapfillzoneLOW,BARINDEX+10,gapfillzoneLOW) COLOURED(255,0,0) ENDIF // Find bearish gaps IF HIGH < LOW[1] AND (LOW[1] - HIGH) > 0.35 * AverageRANGE THEN gapfillzoneHIGH = HIGH gapfillzoneLOW = LOW[1] a = BARINDEX-1 DRAWSEGMENT(a,gapfillzoneLOW,BARINDEX+10,gapfillzoneLOW) COLOURED(0,255,0) DRAWSEGMENT(a,gapfillzoneHIGH,BARINDEX+10,gapfillzoneHIGH) COLOURED(255,0,0) ENDIF RETURN