This script is our version of the "Fair Value Gap".
A Fair Value Gap is nothing more than a series of 3 candles with a gap between a candle high/low and a candle high/low two candles prior.
For example:
A Gap Up - the Low of a candle is higher than the High of two candles back.
A Gap Down - the High of a candle is lower than the Low of two candles back.
Typically, on a Gap Up, the trader would wait for the price to re-enter the Gap, and take a Long position.
Typically, on a Gap Down, the trader would wait for the price to re-enter the Gap, and take a Short position.
We found that simply trading through the Gaps (fill the gap) produced a better result. So we reversed the procedure and the colors to show our suggested direction.
We have added inputs so the trader can determine the size of the Gaps to be plotted on the chart. A minimum and maximum can be set.
The number of Gaps to be displayed can be adjusted.
There is a option to remove Gaps that had been filled, to help keep a clean chart.