I’ve read about a variety of techniques out there for “trading the gap”. A stock opens much higher than the day before, usually showing excitement over some news or earnings event, and then you make your move.

Some techniques use this gap signal as a “buy” as it could signal the start (or continuation) of a trend. Others see this as a signal to sell (i.e. “fade the gap”), as it could be an over-extension and turn into a mean-reversion trade.

I’ve noticed – and I’m sure you have too – that big gaps seem to behave differently than small gaps. So I got to wondering what the statistics might be for different size gaps. And voila, I have some data for you! The results are interesting.

First off, some definitions. What’s a gap? Well it could be defined as an open that is higher than the high of the day before. But if the stock trades down below the previous day’s high, that doesn’t feel like much of a gap. So I’ve defined a gap as a low that is higher than the previous day’s high. It can be as little as $0.01 difference, or as great as whatever…40%? Double? We want to look at all sorts of gaps.

I took Yahoo historical data from 2000 to the end of 2014, for the NYSE and NASDAQ. No filtering for any market conditions or anything else except: the close of the day in question had to be >$15, and the average 10-day volume had to be >100,000 shares. Low-priced or low-volume shares behave less predictably, so I’ve left them out.

I filtered out results that were obvious errors (it’s not the cleanest of data), and ended up with a mere 115,394 data points. Erroneous data usually shows up as massive gaps, so I probably was able to remove most of the offenders.

I took note of a few things:

– the percentage gap between the current day’s low and the previous day’s high.

– the opening price

– the closing price

– the closing price of the 5th day after the ‘gap’ day

My trading hypothesis here was to spot a large gap in intraday trading, and then make a decision to buy at the close of that day. The stock would be held through the fifth day and then sold at the close (with day 1 being the day of the gap). While you can’t know for sure the exact high or low for the day until after the close, you can usually get a good sense for most trades within the last 15 minutes of the day.

That seems a reasonably practical system, although I’m not fleshing out anything beyond that at the moment. This is just hypothetical, to see what sort of gaps yield what sort of results.

I could have divided up the data into vigintiles, but that would have yielded results that would be more complicated to work with in real life. It’s much easier to ask “is this gap between 5% and 6%?” than it is to ask “is this gap between 1.0045% and 2.3311%?” In the real world, we’ll be looking for nice round numbers to simplify our decisions. So I use round numbers for the gap percentages to divide the data up into groups. The vast majority of gaps are of course in the tiny-sized realm, under 1%. As the gaps get bigger, the data points get fewer, and the reliability and/or statistical meaningfulness gets lower.

So each gap-percentage group averages the gain/loss of each trade within that group, to yield a single number for that group. A positive number does NOT mean there are more winners than losers in this group, only that the average of all the trades is positive.

So first I looked at the overall results for all gap-day closes through the close of the 5th day. Note that the percentage groupings do NOT include the lower groups in the average. For labeling purposes I’ve used “<5%” but that does not mean “0% to 5%”. It means “less than 5% but greater than the next lowest group”. Not cumulative, in other words.

So without regard to whether the “gap day” turned out to be an up day or a down day (comparing the close to the open), we get the above chart. The conclusion: buying at the close and selling at the 5th day’s close is likely to be a losing proposition unless your gap is at least 7% or greater. The dip for the range of 10-15% is odd, so perhaps we would focus on gaps that are between 7% and 10%.

You may have noticed in your chart-gazing that some gaps are really big but then fall throughout the day as sellers take their surprise profits. And other stocks just keep going up and up all day. So is there a difference if we buy at the close of a ‘green’ day rather than a ‘red’ day? Let’s take a look:

The chart above shows what happens when you buy at the close of a “green” day and sell at the close five days later. Basically it’s a bad idea to do this for most percentage gaps! Why gap values between 7-8% show an average gain while the rest of the graph is negative (ignoring the infrequent >15% trades) is a mystery. Possibly erroneous data, so I wouldn’t blindly trade it without further investigation. But overall it looks like green-day gaps only lead to misery unless you’re shorting the stock.

Ok so what if there’s a gap up, but then the day closes in the red? Is there an opportunity there?

Sure looks like there might be. Between 5-6% is still a losing (aka “shorting”) proposition even with a down day, but get into the 6-15% range and you’ve got a winner. Note the average gain/loss for the 7-8% range here, at just under 1.4%, is higher than any other percentile on any of the other graphs.

So from this very basic data, without filtering for any other conditions in the stock or the wider market, there are two areas that warrant research: shorting any gap that is in the 5-6% range, or going long any gap in the 6-15% range that also has a “down” day as the first day.

If I get around to it, I’ll take a further look at some other variations, like buying at the next day’s open, or setting limit orders etc. For example, what happens if in the following few days the gap is “filled”, i.e. the price drops down below the low of the gap day? Will it go back up? Maybe if I don’t get lazy or distracted, we’ll find out!