This script was inherited from "GAP DETECTOR" by Asch- and the modified version is being published with consent of the author.
This script identifies gap up or gap down between candle bodies (for the selected time frame). The original script has been reworked to consider Open/Close instead of the High/Low. It identifies "Gap" up/down and indicates them with markers drawn from "Open/Close" of one candle to the "Close/Open" of another.
The default setting is to consider the last 1500 candles. "Gap Up" is indicated by Green bars and "Gap Down" is indicated with Red bars.
Note: Observed on a couple of occasions (w.r.t stock indexes), the script missed a couple of recent gaps. Please (re)validate your charts visually.