#### Topic: Gap Indicator

Gap indicator measures the gap between current open price and previous bar close price.
If the gap is greater than a Minimum Gap, the indicator rises a signal.

There are two logical rules.
- "Positive Gap" - rises buy signal if the gap is positive and sell signal if the gap is negative.
- "Negative Gap" - rises sell signal if the gap is positive and buy signal if the gap is negative.

Formula:

``````// Positive Gap logic
if (Open[bar] > Close[bar - 1] + minGap)
longSignals[bar] = 1;
if (Open[bar] < Close[bar - 1] - minGap)
shortSignals[bar] = 1;

// Negative Gap logic
if (Open[bar] < Close[bar - 1] - minGap)
longSignals[bar] = 1;
if (Open[bar] > Close[bar - 1] + minGap)
shortSignals[bar] = 1;``````

Screenshot: Possible use: Indicator is attached below:

#### Re: Gap Indicator

This would be a useful indicator to check the data with . Since the markets are 24 hours then any gap more than a few pips might be indicative of an error in the data, except over the weekends.