Gap Fill Trading Strategies

Gap Fill Trading Strategies 2024 – Analyzing Opening Gaps [Backtest]

Gap fill trading strategies are popular among traders, especially when it comes to playing the opening gap of the S&P 500. But what exactly is an opening gap? This article explores the basics of gap trading strategies, focusing on understanding different types of gaps, the possibility of filling gaps, and even predicting gap openings. Additionally, it delves into a specific trading strategy known as “fade the gap,” providing insights into how traders can go against the direction of the gap for potential profits. Let’s dive into the world of gap trading strategies and explore how they work in stock trading.

Searching on the internet you can find a lot of articles on how to play the opening gap of the S&P 500. Gap trading strategies are popular.

What is an opening gap? 

An opening gap is when the opening price (or print) is higher or lower than the previous close. A gap up indicates the opening is higher than the previous close and vice versa.

gap-fill

Other traders might define gaps more stringent: a gap up is when the opening is higher than yesterday’s high, and a gap down when the opening is lower than yesterday’s low.

Gap Fill

What are the different types of gaps?

The three most common types of gaps are runaway gaps (breakaway gaps), exhaustion gaps, and common gaps.

Let’s look at them in more detail:

Common gaps

As the name implies, these are gaps that are “common” and frequent. For example, the S&P 500 opens up or down more or less every day. Most of the days this is just noise and hardly worth to write about (in the news). Typically, the gaps are in the range of plus/minus 0.25%.

Runaway gaps

This gap is often called breakaway gaps. This gap usually leads to higher or lower prices in the same direction of the gap. If it gaps up, we can expect higher prices in the future.

However, it’s easy to explain with hindsight.

Exhaustion gaps

Exhaustion gaps happen after an already extended move in one direction.

For example, if the S&P has had a sudden move over several days upwards, we have a potential exhaustion gap if it one day gaps up more than normal (average).

An exhaustion gap signals the end of the move: it’s the climax.

Do opening gaps get filled?

Most small gaps are filled the very same day, while bigger gaps need more time (days) to get filled.

But it depends on the size of the gap and time. You can read more about gaps in this article. We have previously also written about unfilled gap.

Some gaps need many days to fill, some even months, and some never (applies more to single stocks – not indices).

Can you predict a gap opening?

You can predict a gap opening by using statistics to indicate the probability of a gap up or down opening the next day based on statistics.

Also, overnight futures trading shows where the market will open, but it might change on short notice.

The market’s activity before the official opening is easy to spot. All liquid ETFs and futures contracts indicate where the market will open, but of course, it might vary from minute to minute.

Opening gap strategy in the S&P 500 (SPY Gap Fill)

Today, I put my personal twist on this strategy. Over the last two months, I’ve been trading a similar strategy, but not the same as the one I’ve tested here.

Here are the details (for long):

  1. If SPY gaps down lower than -0.15% but higher than -0.6%, go long at the opening print/cross. The reason I use -0.6% as the maximum is that SPY shows a lot less mean reversion if opening lower. To me that makes sense. Usually, there is not that much “news” if SPY opens for example -0.4% down compared to for example 1%. However, if SPY opens more than 1% down it’s a good short, vice versa for long if it opens above 1%.
  2. Target is 0.75 of the gap. If it opens down -0.5%, the target is 0.375% higher than the fill price. If the target is not reached exit is at the close. No other stops.
  3. Yesterday’s close must be lower than 0.25 of this formula: (close-low)/(high-low). The reason I use this is because of SPY’s mean-reversion tendencies. It means fewer fills, but a higher average per fill. The tighter I set these criteria, the better average per fill (but obviously less fills).

The test period is from 1. January 2010 until August 2012. In total there are 110 fills and 98 winners. The average per fill is a respectable 0.19%. Here is the equity curve:

SPY Gap Fill

Here is the distribution:

Small winners and occasionally a big loser.

The data is adjusted for dividends and collected from Yahoo! and IQFeed. I have tested on both data sets with not much difference. I have used EOD quotes, ie. only open, high, low and close.

I wrote this article on September 20, 2012, a perfect day for this strategy. SPY opened down about 0.47% and filled the gap until yesterday’s close.

The strategy seems very robust and yields very good numbers.  Perhaps too good to be true? Yes, it’s probably too good to be true. The reason is that some of the high and low quotes are wrong, boosting the numbers. That’s why I’ll write a second article on this strategy and test it on intraday data from IQFeed. Then we’ll find out if there is a discrepancy in the data sets (which I believe it is).

Any thoughts about this strategy? I know this strategy didn’t perform very well some years ago. However, markets always change and we have to adjust. You won’t find a strategy that lasts year after year.

The opening gap strategy above showed promising returns. However, can we trust the data? The test was performed on EOD data from Yahoo! (open, high, low, and close per day).

Today I have downloaded 30 mins data from IQFeed. The test period is the same: 1. January 2010 until 1st of July 2012. All the other parameters are the same. The result is still quite good:

In total there are 89 fills, 21 less than on the EOD test.  The average gain for long is 0.22% and 0.08% for short.

I have no idea why the numbers are so different. This proves that backtesting is just an indication, you need to test live to grasp the strategy.

—————–

I decided to research opening gaps in SPY (S&P 500) to find fade-the-gap strategies. After all, many traders claim to make good money on this strategy, at least according to my web search.

For me, this is unknown territory as up until this date I have only been day trading stocks, and my experience in trading indices is close to zero.

My database in this sample is from January 2005 until October 2012. I’m using EOD data on SPY downloaded from Yahoo! Finance. This means I only check the SPY’s Open, High, Low and Close for the day. There is no intraday data. I suspect the results are a lot better than to expect in live trading, keep that in mind.

In my first post about opening gaps, I faded (going against the gap) gaps under 0.6%. In my findings below I’m fading every gap between 0.1% to 0.6% (and vice versa). Target is 75% of the gap size from the close.

Day of week

Mondays:

Total in %#fills#winsAvg
12.052001600.060

Tuesdays:

Total in %#fills#winsAvg
11.762311820.051

Wednesdays:

Total in %#fills#winsAvg
22.682392020.095

Thursdays:

Total in %#fills#winsAvg
18.942131810.089

Fridays:

Total in %#fills#winsAvg
17.992101720.086

The equity curve looks the best on Fridays, a lot steadier on that day. The later in the week, the better. I don’t know why. But it opens opportunities to trade other twists earlier in the week.

Period of month

Day 1 to (and including) 10:

Total in %#fills#winsAvg
22.053492770.063

Day 11 to 20:

Total in %#fills#winsAvg
27.113663030.074

Day 21 to 31:

Total in %#fills#winsAvg
34.273783170.091

Worth noting is that the 1st day of the month is horrible. The last two days of the month are very good.

Gaps inside yesterday’s bar

When SPY either opens below yesterday’s high or above yesterday’s low:

Total in %#fills#winsAvg
43.567346100.059

Gaps outside yesterday’s bar

When SPY opens above yesterday’s high or below yesterday’s low:

Total in %#fills#winsAvg
39.883592870.111

The equity curve looks a lot better for gaps outside yesterday’s bar than those gaps inside. The average is also a lot better.

Gaps outside 3 days range

Gap up must open higher than the high of the previous 3 days and vice versa for longs.

Total in %#fills#winsAvg% long% short#fills long#fills short
24.141971580.1236.6517.5056141

This equity curve looks really nice! These days we can even trade gaps up until 0.75% with very good results.

Yesterday unfilled gap down

If yesterday gapped down (when high of yesterday is lower than low two days ago):

Total in %#fills#winsAvg% long% short#fills long#fills short
5.2133300.1583.212.001221

Very good results, but not surprisingly it’s long which is best. All longs hit the target. A good example of reverting to the mean.

Yesterday unfilled gap up

Total in %#fills#winsAvg% long% short#fills long#fills short
8.9766580.1366.482.493432

If it’s a gap up the day before, both directions are good. In general, if unfilled gap yesterday, the better chances to fade the gap.

Gaps after a high range day

What happens if yesterday had a higher range (HIGH-LOW) than the 15 days average?

Total in %#fills#winsAvg% long% short#fills long#fills short
34.304393630.07819.5714.73168271

Gaps after a low range day

Total in %#fills#winsAvg% long% short#fills long#fills short
48.866405270.07618.5230.34297343

Gaps when yesterdays close was above 10 day moving average

Total in %#fills#winsAvg% long% short#fills long#fills short
56.946825610.08323.8533.09326356

Gaps when yesterdays close was lower than 10 day moving average

Total in %#fills#winsAvg% long% short#fills long#fills short
26.324043320.06514.2412.08141263

Gaps when yesterdays close was at least 2% above 10 day moving average

Total in %#fills#winsAvg% long% short#fills long#fills short
11.2394840.1206.874.365935

Gaps when yesterdays close was at least 2% below 10 day moving average

Total in %#fills#winsAvg% long% short#fills long#fills short
15.8986820.1859.146.753452

Gaps when the close is above 0.5 in yesterday’s range

Here I’m using the formula (CLOSE-LOW)/(HIGH-LOW) to decide yesterday’s range:

Total in %#fills#winsAvg% long% short#fills long#fills short
34.986124850.05712.9022.08280332

Gaps when the close is below 0.5 in today’s range

Total in %#fills#winsAvg% long% short#fills long#fills short
47.984794100.10025.0622.92189290

Gaps when the close is above 0.75 in yesterday’s range

Total in %#fills#winsAvg% long% short#fills long#fills short
27.673592990.07711.2116.47167192

Gaps when the close is below 0.25 in today’s range

Total in %#fills#winsAvg% long% short#fills long#fills short
32.762642290.12414.7717.9998166

Why is gaps much better when yesterday’s close is lower than 0.25? Both long and short are better with a nice and steady upward sloping equity curve.

Gaps when yesterday’s open is lower than yesterday’s close

Total in %#fills#winsAvg% long% short#fills long#fills short
39.445564510.07117.5521.89261295

Gaps when yesterday’s open is higher than yesterday’s close

Total in %#fills#winsAvg% long% short#fills long#fills short
43.715284390.08319.5724.14203325

Yesterday gapped down and closed below 0.33 on the daily range

Total in %#fills#winsAvg% long% short#fills long#fills short
10.301601340.0644.395.916298

Yesterday gapped up and closed above 0.66 on the daily range

Total in %#fills#winsAvg% long% short#fills long#fills short
17.202622170.06611.016.19132130

Gaps on the day of the monthly jobs report

This is the most important macroeconomic news in the month and might be worth considering. It’s on the first Friday of the month. Friday is the best gap day of the week. Here is the result on those days:

Total in %#fills#winsAvg% long% short#fills long#fills short
3.4044360.0772.201.201331

The win rate is pretty good, but the average is below other Fridays. So this is perhaps worth mentioning.

Developing a fade the gap strategy is not easy, but hopefully, the numbers provided in this article help you get started. Gap trading strategies have been around for a long time, but the window of opportunity is getting smaller with the increased computer power that arbs away the anomalies.

——–

If you would like to have the code for this strategy plus 70+ other free trading strategies published on this website, please click on this link:

For more trading strategies, please click here:

Do gaps in stock prices get filled?

Whether gaps get filled depends on their size and time. Small gaps are often filled on the same day, while larger gaps may take several days or months.

Is it possible to predict gap openings in stock trading?

Market activity before the official opening can predict the gap opening, and statistical analysis can offer insights into the probability of gap ups or downs.

What is a “fade the gap” strategy in stock trading?

Fading the gap strategy involves trading against the direction of the gap. For example, if a stock gaps down, a trader might go long expecting the price to recover.

How long does it typically take for small gaps in stock prices to get filled?

Small gaps are often filled on the same day, while larger gaps may take several days or even months to fill.

Can market activity before the official opening help predict gap openings in stock trading?

Market activity before the official opening can provide some indication of gap direction, and statistical analysis can offer insights into the probability of gap ups or downs.

What exactly is a “fade the gap” strategy in stock trading?

Fading the gap strategy involves trading against the direction of the gap. For example, if a stock gaps down, a trader might go long expecting the price to recover.

Are gaps in stock prices more likely to be filled on certain days of the week?

Gaps in stock prices are more likely to be filled on certain days of the week. The data and statistics suggest that later in the week, particularly on Fridays, gaps in stock prices are more likely to be filled. However, the reasons behind this trend are not fully understood.

How does the size of yesterday’s range impact the effectiveness of gap trading strategies?

Gaps in stock prices tend to perform better when yesterday’s range, measured by the formula (CLOSE-LOW)/(HIGH-LOW), is below 0.25. In such scenarios, both long and short positions show better results with a steady upward-sloping equity curve.

Similar Posts