Skip to content
All library documents

Detecting Price Gaps and Marking Their Potential Closure

Article ProRealCode

Summary

This document presents a charting indicator that detects upward and downward gaps by comparing the prior bar's low and high with the bar before it. It labels detected gaps and draws horizontal reference lines at the corresponding price levels, using different colors for upward and downward gaps. The author describes a chart with three upward gaps and one downward gap, and notes that some gaps have closed while one remains open.

The post is a request for help extending the indicator so unclosed gaps can be visualized and horizontal lines can disappear after closure; it does not supply that extension or a tested trading strategy. Its examples show how to mark candidate gap levels, but give no evidence that gaps reliably close or that trading around them is profitable. The gap definition and display behavior depend on the charting platform and bar data, so the code's signals should be understood as visual aids rather than validated market predictions.

Key ideas

  • The indicator detects upward and downward gaps by comparing adjacent bars' price ranges.
  • It marks detected gaps with labels and horizontal price lines.
  • The author wants open gaps to remain visible and closed-gap lines to disappear.
  • The post offers no completed solution for tracking gap closure or evidence of trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.