Tested by BacktestingMax
Gap and go backtest on NQ and ES futures
Does the gap and go strategy work on NQ and ES futures?
Yes on the 5-minute chart, in our backtest: after trading costs, it made money on all 4 futures we tested. Gap and go trades in the direction of the overnight gap: the move from the previous day's 16:00 close to the price at 09:30 New York time. After a gap up of at least 0.5%, it waits for the first 5-minute candle to close higher than it opened. Then it buys when price rises above that candle's high. The stop-loss is at the candle's low. The take-profit is twice as far above the entry as the stop-loss is below it (2R). After a gap down, it sells short (sells first, to profit if price falls). These are the basic rules. From 2020 to 2025, we tested MNQ and MES, the micro versions of NQ and ES, plus YM (Dow) and RTY (Russell 2000). Each trade risked 1% of the account, which started at $50,000. On the 5-minute chart, the account grew 114.8% on MES (213 trades) and 45.3% on MNQ (282 trades), with a profit in both 2020–2023 and 2024–2025. YM made +28.5% and RTY +21.5%, but both lost money in 2024–2025. With the first 1-minute candle (09:30 to 09:31), MES, YM and RTY lost money. The gap mattered: on days with gaps under 0.5%, the same 5-minute rules lost money on 3 of the 4 markets.
8 backtests 2020–2025 Trading costs included Tested 26 October 2026
Where it worked 8 backtests- Made money
- 5 of 8 tests, with the basic rules
- Made money in both periods
- 2 2020–2023 and again 2024–2025
- Best backtest
- +115% MES (Micro S&P 500), 5-minute chart: account growth 2020–2025
- Holding until 16:00 (no take-profit)
- 4 tests made money in both periods, compared with 2 with the basic rules
Made money in both periods
- MNQ (Micro Nasdaq 100), 5-minute
- MES (Micro S&P 500), 5-minute
The results
Results on every market
Each box shows one backtest of the gap and go strategy with the basic rules, from 2020 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2020–2023 and 2024–2025, or passed all four of our checks (see "How a test passes" further down).
| Market | 1-minute | 5-minute |
|---|---|---|
| MNQ (Micro Nasdaq 100) | +10% Made money overall, lost in one period | +45% Passed all four checks |
| MES (Micro S&P 500) | −17% Lost money | +115% Passed all four checks |
| YM (Dow futures) | −12% Lost money | +29% Made money overall, lost in one period |
| RTY (Russell 2000 futures) | −31% Lost money | +22% Made money overall, lost in one period |
All the numbers, test by test
| Market | Chart | Trades | Win rate | Profit factor | Result | Max drawdown | 2020–2023 | 2024–2025 | Monte Carlo drawdown | Trading costs |
|---|---|---|---|---|---|---|---|---|---|---|
| MNQ (Micro Nasdaq 100) | 1-minute | 291 | 35.7% | 1.06 | +10.0% | −27.4% | −4.3% | +14.9% | −28.7% | $4,017 |
| MNQ (Micro Nasdaq 100) | 5-minute | 282 | 41.5% | 1.26 | +45.3% | −8.8% | +28.3% | +13.3% | −18.9% | $2,149 |
| MES (Micro S&P 500) | 1-minute | 208 | 33.2% | 0.86 | −16.8% | −29.6% | −24.3% | +9.9% | −33.6% | $6,020 |
| MES (Micro S&P 500) | 5-minute | 213 | 48.4% | 1.69 | +114.8% | −7.7% | +80.8% | +18.8% | −13.0% | $4,920 |
| YM (Dow futures) | 1-minute | 190 | 31.6% | 0.88 | −11.8% | −16.3% | −12.8% | +1.1% | −26.7% | $2,238 |
| YM (Dow futures) | 5-minute | 131 | 44.3% | 1.45 | +28.5% | −10.5% | +30.6% | −1.6% | −10.9% | $1,003 |
| RTY (Russell 2000 futures) | 1-minute | 330 | 30% | 0.80 | −31.0% | −33.4% | −15.2% | −18.7% | −41.6% | $3,678 |
| RTY (Russell 2000 futures) | 5-minute | 253 | 39.9% | 1.16 | +21.5% | −25.3% | +38.8% | −12.4% | −17.1% | $2,063 |
Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2020–2023 and 2024–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.
The account balance
The best test and the middle test
What we found
What the 8 backtests show
The size of the gap mattered. We also ran the rules on every trading day, without the 0.5% minimum gap, and grouped the trades by gap size (see the table below). The results are in R. 1R is 1% of the account at the time of the trade, the amount each trade was sized to risk. Futures trade in whole contracts, so most trades risked a little less: about 0.9% to 1% on MNQ and MES, and about 0.75% on YM and RTY. On the 5-minute chart, the trades after gaps of 0.5% or more made money on all 4 markets. After smaller gaps, they lost money on MNQ, MES and YM, and made almost nothing on RTY. On MES, the average trade made +0.36R after a gap of 0.5% or more, and lost 0.19R after a smaller gap. Bigger gaps were not always better: gaps of 1% or more did worse than gaps of 0.5% to 1% on MNQ, YM and RTY.
The rule that the first candle must close in the gap's direction mattered too. A candle closes with the gap when it closes higher than it opened after a gap up, or lower after a gap down. We also tested a version without this rule, called 'No first-candle rule' (see 'Can the gap and go strategy be improved?' below). It traded every gap of 0.5% or more, whichever way the first candle closed. On the 5-minute chart, the trades after a first candle that closed against the gap lost money on 3 of the 4 markets. They made −3.1R on MNQ, +7.2R on MES, −3.9R on YM and −9.0R on RTY. The trades after a first candle that closed with the gap made +38.2R, +79.1R, +23.9R and +20.3R (see the chart below). The first 5-minute candle closed with the gap on fewer than half of the gap days: 301 of the 672 on MNQ, and 226 of the 504 on MES. So the rule skips more than half of the gap days, and on those days the trades made little or lost money.
The rules did much worse on the 1-minute chart, where the first candle is 09:30 to 09:31, than on the 5-minute chart. On the 1-minute chart, MES lost 16.8%, YM 11.8% and RTY 31.0% from 2020 to 2025, and MNQ made only +10.0%. On MES, YM and RTY, the 1-minute trades lost money even before trading costs. A 1-minute candle is small, so the stop-loss is close. On MNQ, the middle (median) first candle was 25.75 points high on the 1-minute chart, compared with 52.75 points on the 5-minute chart. So more trades hit the stop-loss: 64% to 70% of the 1-minute trades, compared with 52% to 57% on the 5-minute chart. A close stop-loss also means more contracts for the same 1% risk, and costs are paid per contract. On MES, costs took 6.6% of the money a typical trade risked on the 1-minute chart, compared with 3.0% on the 5-minute chart.
Both directions made money on the 5-minute chart. The sells after gap downs made +17.6R on MNQ, +38.1R on MES, +20.3R on YM and +6.1R on RTY, and the buys after gap ups made +22.0R, +40.6R, +5.6R and +14.8R. Unlike the sells on our 5-minute opening range breakout page, which lost money on MNQ and MES, every sell here came after a gap down of at least 0.5%.
YM and RTY made money from 2020 to 2025 on the 5-minute chart, but both lost money in 2024–2025, and both skipped many days. They are full-size contracts (called E-mini), ten times the size of their micro versions, which are not in our data. On a typical day when the gap and the first candle met the rules, the first 5-minute candle was 97 points high on YM. That is $485 of risk per contract. On RTY, it was 8.9 points, or $445. The backtest skipped any day when one contract risked more than 1% of the account ($500 at the start). So YM traded on 131 of the 209 days when price reached the order, and RTY on 253 of 327. Most of their trades used one contract. With a $50,000 account and 1% risk, one YM or RTY contract was often too big to trade.
Gap size
After gaps of 0.5% to 1%, the rules made money on all 4 markets
We ran the rules on every trading day, without the 0.5% minimum gap, on the 5-minute chart, from 2020 to 2025. On every day, the first 5-minute candle still had to close in the gap's direction. Gap sizes count gaps up and gaps down. Each cell shows the average result per trade, after trading costs, with the number of trades in brackets. The results are in R: 1R is 1% of the account at the time of the trade. The basic rules trade only gaps of 0.5% or more: the last two columns.
| Market | Gap under 0.25% | 0.25% to 0.5% | 0.5% to 1% | 1% or more |
|---|---|---|---|---|
| MNQ | −0.13R (222) | +0.04R (152) | +0.17R (171) | +0.04R (111) |
| MES | −0.14R (247) | −0.25R (179) | +0.35R (138) | +0.38R (75) |
| YM | −0.02R (214) | −0.01R (132) | +0.24R (105) | −0.01R (34) |
| RTY | +0.09R (137) | −0.10R (123) | +0.07R (149) | +0.03R (87) |
This run traded on more days than the basic rules, so its account balance, and so the size of its trades, was different. That is why its results for gaps of 0.5% or more are a little different from the results of the basic rules. On YM and RTY, it also skipped different days, when one contract risked more than 1% of the account. On the 1-minute chart, no gap size made money on all 4 markets, and gaps of 1% or more lost money on all 4.
The first candle
When the first candle closed against the gap, the trades lost money on 3 of the 4 markets
These trades come from a version without the first-candle rule, called 'No first-candle rule' (see 'Can the gap and go strategy be improved?' below). On the 5-minute chart, from 2020 to 2025, it traded every gap of 0.5% or more, whichever way the first candle closed. Each bar adds up the results of the trades, after trading costs. The results are in R: 1R is 1% of the account at the time of the trade. Green bars made money in total; red bars lost money.
- MNQ, first candle closed with the gap282 trades +38.2R
- MNQ, first candle closed against the gap273 trades −3.1R
- MES, first candle closed with the gap213 trades +79.1R
- MES, first candle closed against the gap220 trades +7.2R
- YM, first candle closed with the gap127 trades +23.9R
- YM, first candle closed against the gap121 trades −3.9R
- RTY, first candle closed with the gap256 trades +20.3R
- RTY, first candle closed against the gap212 trades −9.0R
The basic rules take only the days when the first candle closed with the gap. A total in R is a sum of trades, so it is not the same as the % change in the account. The 'with the gap' bars are close to the results of the basic rules, but not exactly the same, because this version had a different account balance. On YM and RTY, it also skipped different days, when one contract risked more than 1% of the account.
The exit
Holding until 16:00 changed the 1-minute results most
We also tested a version that holds each trade until 16:00 New York time instead of taking profit at 2R (see 'Can the gap and go strategy be improved?' below). Each row is one market and chart, tested with both exits. Both use the same entry and the same stop-loss. The 2R take-profit is the exit in the basic rules. The first two result columns show the change in the account from 2020 to 2025, after trading costs. The last two show 2024–2025 only.
| Market | Chart | 2R take-profit, 2020–2025 | Holding until 16:00, 2020–2025 | 2R take-profit, 2024–2025 | Holding until 16:00, 2024–2025 |
|---|---|---|---|---|---|
| MNQ | 1-minute | +10.0% | +315.6% | +14.9% | +94.5% |
| MNQ | 5-minute | +45.3% | +75.7% | +13.3% | +19.7% |
| MES | 1-minute | −16.8% | +64.2% | +9.9% | −0.8% |
| MES | 5-minute | +114.8% | +94.6% | +18.8% | +17.7% |
| YM | 1-minute | −11.8% | −0.8% | +1.1% | −4.7% |
| YM | 5-minute | +28.5% | +41.5% | −1.6% | +3.2% |
| RTY | 1-minute | −31.0% | +36.6% | −18.7% | −37.2% |
| RTY | 5-minute | +21.5% | +7.2% | −12.4% | −12.4% |
A 1-minute candle is small, so the stop-loss is close. Some trades held until 16:00 made many times their risk: on MNQ's 1-minute chart, 12 trades made 10R or more. Those few days made most of the result. Of the +162.0R that holding made on MNQ's 1-minute chart, the 10 best trades made +146.0R. Without a take-profit, fewer trades won: 17% to 19% on the 1-minute chart and 33% to 38% on the 5-minute chart. On YM and RTY, the two exits did not trade on exactly the same days. Each exit left the account at a different balance, so one contract fit the 1% risk on different days.
The strategy
What the gap and go strategy is
An overnight gap is the difference between two prices. The first is the price at 09:30 New York time, when the US stock market opens. The second is the close at 16:00 New York time on the previous trading day. Stock index futures such as NQ (Nasdaq 100) and ES (S&P 500) trade almost 24 hours a day. So for futures, the gap is how far price moved while the stock market was closed. We measure it as a percentage of the previous close. Gap and go is a day-trading strategy that expects the gap to keep going in the same direction. After a gap up, the strategy waits for the first candle after 09:30 to close higher than it opened. Then it buys when price rises above that candle's high. After a gap down, it waits for a first candle that closes lower than it opened. Then it sells short when price falls below that candle's low. Our overnight gap fill page tests the opposite idea: trading against the gap, back toward the previous close. We measured the gap the same way on both pages, so you can compare their results. Gaps of 0.5% or more happened on 672 days on MNQ, 45% of the trading days in the test, and on 504 days on MES (34%). We tested 4 markets. MNQ (Micro Nasdaq 100) and MES (Micro S&P 500) follow the same prices as NQ and ES, but one contract is one tenth of the size. YM (Dow) and RTY (Russell 2000) are full-size contracts, called E-mini. They are ten times the size of their micro versions (MYM and M2K), which are not in our data. We used 5-minute charts, where the first candle is 09:30 to 09:35, as in the usual gap and go rules. We also used 1-minute charts, where the first candle is 09:30 to 09:31, which some day traders use instead.
- Gap
- The price at 09:30 New York time compared with the previous trading day's close at 16:00, as a % of that close. We traded gaps of 0.5% or more, up or down. Our overnight gap fill page measures the gap the same way.
- First candle
- 09:30 to 09:35 on the 5-minute chart, and 09:30 to 09:31 on the 1-minute chart. It must close in the direction of the gap: higher than it opened after a gap up, lower after a gap down.
- Entry
- A stop order: an order that buys when price rises to its price, or sells when price falls to it. It sits at the first candle's high after a gap up, or at its low after a gap down, and waits until 16:00 New York time.
- Stop-loss
- The other end of the first candle
- Take-profit
- 2R: twice as far from the entry as the stop-loss. A trade still open at 16:00 New York time closes then.
- Trades per day
- 1 at most
- Risk per trade
- 1% of the account, rounded down to whole contracts. No trade that day if one contract would risk more than 1%.
- Order prices
- The stop order and the stop-loss fill at their price, or at a candle's open if price opens beyond it. On the 5-minute chart, 22 of the 879 entries filled beyond the order price, typically by 1 or 2 ticks. The stop-loss and the take-profit stayed at their prices. The take-profit fills at its exact price. When price reaches two of these levels in the same candle, the backtest looks at the 1-minute candles inside it to see which came first. If both are in the same 1-minute candle, it counts the stop-loss.
- Price data
- We used BacktestingMax's futures data. It is built from CFD prices (a broker's price that follows the same index). We adjust them to match the real contracts: their price, trading hours, tick (the smallest price step) and roll (the switch from one contract month to the next). It is not exchange data.
- Trading costs
- The spread is the difference between the buy price and the sell price. We used 1 tick: 0.25 points on MNQ and MES, 1 point on YM and 0.1 points on RTY. A trade pays half of the spread when it closes at the stop-loss or at 16:00. The entry is a stop order, and the take-profit is a limit order (an order that fills only at its price or better). In the backtest, neither pays the spread. In live trading, a stop order can fill a tick or more worse when price moves fast. With every entry 1 tick worse, the 5-minute results would have been lower by at most about 1.5R on MNQ, 5.5R on MES, 1.8R on YM and 3.4R on RTY. Their totals were +39.6R, +78.7R, +25.9R and +20.9R. The backtest also fills the take-profit as soon as price touches it, but a real limit order is not always filled on a touch. On the 5-minute chart, price went at least 1 tick past the take-profit before reaching the stop-loss in 316 of the 317 trades that reached it. Every trade also pays a commission when it opens and again when it closes: $0.62 per MNQ or MES contract, and $2.50 per YM or RTY contract.
The rules we tested
- Each trading day, compare the price at 09:30 New York time with the previous trading day's close at 16:00 New York time. The gap is the difference, as a % of that close. The 09:30 price is the close of the candle that ends at 09:30, and the 16:00 close is the close of the candle that ends at 16:00.
- Trade only when the gap is at least 0.5%, up or down.
- Wait for the first candle after 09:30 to close. On a 5-minute chart, it is the candle from 09:30 to 09:35. On a 1-minute chart, it is the candle from 09:30 to 09:31. After a gap up, the candle must close higher than it opened. After a gap down, it must close lower than it opened. If it doesn't, don't trade that day.
- After a gap up, place a buy stop order at the first candle's high. A buy stop order buys as soon as price rises to its price. After a gap down, place a sell stop order at the candle's low, which sells short as soon as price falls to it.
- Put the stop-loss at the other end of the first candle: at its low for a buy, and at its high for a sell. So the stop-loss is one candle height away from the entry. Put the take-profit twice as far away, in the direction of the trade. Traders call this a 2R take-profit, where R is the risk of the trade.
- The order waits until 16:00 New York time, even if price first falls below the candle's low (for a buy) or rises above its high (for a sell). If price never reaches the order, cancel it at 16:00: there is no trade that day. If a trade is still open at 16:00, close it then.
- Take one trade a day at most.
- Size every trade so that a loss at the stop-loss would cost 1% of the account balance at that time, not counting trading costs. Futures trade in whole contracts, so round down to a whole number of contracts. If even one contract would risk more than 1% of the account, skip the day.
- Don't trade on days the New York Stock Exchange is closed, or closes early at 13:00. After a holiday, the gap counts from the last close before it. After an early close, it counts from the 13:00 close.
The method
How we tested it
The test
- Markets
- MNQ (Micro Nasdaq 100), MES (Micro S&P 500), YM (Dow futures) and RTY (Russell 2000 futures)
- Charts
- 1-minute and 5-minute candles
- Dates
- January 2020 to December 2025
- Account
- $50,000, risking 1% of the account on each trade
- Trading costs
- Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.
How a test passes
We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.
- At least 100 trades. With fewer trades, a good result could be luck.
- It made money from 2020 to 2023 and again from 2024 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
- A profit factor (the money won divided by the money lost) of at least 1.2 from 2024 to 2025, after trading costs.
- In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.
Improvements
Can the gap and go strategy be improved?
Besides the basic rules, we tested three versions. Each one changes one rule, the way traders often do: trading only full gaps, dropping the first-candle rule, or holding each trade until 16:00 with no take-profit. The table below explains each one. Each version ran on the same 8 tests: the 4 markets, each on the 1-minute and the 5-minute chart. We picked the best version using 2020–2023 only: the one that made money in the most tests. In a tie, it is the one with the better middle result (the median of the 8 tests). Then we checked it on 2024–2025, the years we did not use to pick it. If you pick a version and judge it on the same years, it almost always looks better than it really is.
| Version | Made money 2020–2023years used to pick the best version | Made money 2024–2025years not used to pick it | Made money in both periods | Passed all four checks |
|---|---|---|---|---|
| Basic rules The rules under 'The rules we tested': the first candle must close in the gap's direction, the stop-loss is at its other end, and the take-profit is 2R. | 4 of 8middle test +12.0% | 5 of 8middle test +5.5% | 2 | 2 |
| Only full gaps Trade only when the 09:30 price is above the previous day's high after a gap up, or below the previous day's low after a gap down. The high and the low are from the previous day's stock market session, 09:30 to 16:00 New York time. Traders call these full gaps. Many say they keep going more often than gaps that open inside the previous day's range. | 2 of 8middle test −5.8% | 5 of 8middle test +4.7% | 2 | 2 |
| No first-candle rule Trade the first candle's high or low in the gap's direction, whichever way the candle closed. After a gap up, buy above the first candle's high even if the candle closed lower than it opened. Some traders skip the first-candle rule, because they think the move past the candle shows the direction. | 4 of 8middle test −0.4% | 4 of 8middle test +0.2% | 2 | 1 |
| Holding until 16:00 (no take-profit)Best on 2020–2023 There is no take-profit. The trade ends at the stop-loss, or at 16:00 New York time. Gap and go traders hope for a trend day, when price keeps moving in one direction until the close. | 8 of 8middle test +56.0% | 4 of 8middle test +1.2% | 4 | 3 |
No version clearly beat the basic rules. Using 2020–2023, we picked holding until 16:00: it made money in all 8 tests in those years, compared with 4 with the basic rules. On 2024–2025, the years we kept for the check, it made money in 4 of 8 tests, compared with 5 with the basic rules. Its middle result in 2024–2025 was +1.2%, compared with +5.5%. Holding made money in both periods in 4 tests, compared with 2 with the basic rules: it added MNQ's 1-minute chart and YM's 5-minute chart. Holding changed the 1-minute chart most (see the table 'Holding until 16:00 changed the 1-minute results most' above). On MNQ's 1-minute chart, it made +315.6% from 2020 to 2025, compared with +10.0% with the basic rules, and it made money in both periods. But on the 1-minute charts of MES, YM and RTY, holding lost money in 2024–2025. On the 5-minute chart, holding made more on MNQ and YM, and less on MES and RTY. Trading only full gaps made less money than the basic rules in all 4 tests on the 5-minute chart. Per trade on that chart, full gaps did better than the gaps that opened inside the previous day's range only on MNQ: +0.21R on average, compared with +0.04R. Dropping the first-candle rule made more on MES's 5-minute chart (+127.1%, compared with +114.8%), with about twice as many trades. But its biggest fall from the highest balance was 11.5%, compared with 7.7%, and it made less in all the other tests.
Passed all four checks with holding until 16:00 (no take-profit)
- MNQ (Micro Nasdaq 100), 5-minute
- MES (Micro S&P 500), 5-minute
- YM (Dow futures), 5-minute
Questions
Questions traders ask
Does the gap and go strategy work on futures?
On the 5-minute chart, yes in our backtest. We tested 4 US stock index futures from 2020 to 2025, after trading costs: MNQ, MES, YM and RTY. The account started at $50,000, and each trade risked 1% of the balance at that time. The rules trade gaps of at least 0.5% at 09:30 New York time. They wait for the first 5-minute candle to close in the gap's direction, then enter when price moves past that candle's high or low. On the 5-minute chart, all 4 made money: MES +114.8%, MNQ +45.3%, YM +28.5% and RTY +21.5%. MES and MNQ made money in both 2020–2023 and 2024–2025, and passed all four of our checks. On MES, 48.4% of the trades made money, and 46.5% reached the 2R take-profit. YM and RTY lost money in 2024–2025. On the 1-minute chart, where the first candle is 09:30 to 09:31, 3 of the 4 lost money.
Gap and go or gap fill: which works better on NQ and ES?
In our backtests, gap and go made more. Gap and go and our overnight gap fill strategy measure the gap the same way: the price at 09:30 New York time against the previous day's 16:00 close. From 2020 to 2025, on the 5-minute chart, gap and go made +45.3% on MNQ (micro NQ) and +114.8% on MES (micro ES). The gap fill strategy trades against gaps of 0.25% to 1% at 09:30, and it made +22.3% on MNQ and +4.6% on MES. On MNQ, 171 days had a trade from both strategies. On those days, gap and go made +32.3R and the gap fill lost 56.8R, where 1R is 1% of the account. On MES, on the 138 days when both traded, gap and go made +49.6R and the gap fill lost 51.4R. But those days favour gap and go. On all of them, the first 5-minute candle had closed in the gap's direction, which is the gap and go signal. The gap fill had already opened its trade at 09:30, before that candle closed. The comparison leaves out the days when only one of the two strategies traded.
How big should the gap be for a gap and go?
In our backtest, the gap needed to be at least 0.5%, but bigger was not always better. We ran the gap and go rules on every trading day, without a minimum gap, on the 5-minute chart. After gaps of 0.5% to 1%, the average trade made money on all 4 markets: from +0.07R on RTY to +0.35R on MES, where 1R is 1% of the account. After gaps under 0.5%, the trades lost money on MNQ, MES and YM, and made almost nothing on RTY. Gaps of 1% or more did worse than gaps of 0.5% to 1% on MNQ, YM and RTY, and about the same on MES. These groups come from one backtest. We did not test each gap size as its own set of rules, so treat them as a guide.
What is the best timeframe for gap and go?
We tested two charts, 1-minute and 5-minute, and the 5-minute chart did better. With the first 5-minute candle (09:30 to 09:35), the rules made money on all 4 markets. With the first 1-minute candle (09:30 to 09:31) and the 2R take-profit, MES, YM and RTY lost money, and MNQ made only +10.0%. The 1-minute candle is small, so more trades hit the stop-loss, and each trade needs more contracts, which cost more. Holding the trade until 16:00, with no take-profit, changed the result on MNQ's 1-minute chart. It made +315.6% from 2020 to 2025, with a profit in both 2020–2023 and 2024–2025, but 10 trades made most of that. On the 1-minute charts of MES, YM and RTY, holding lost money in 2024–2025. On the 5-minute chart, most trades opened within 5 minutes of the first candle's close: 70% to 74% by 09:40 New York time.
Keep exploring
Related strategies we tested
Gaps Overnight gap fill backtest on NQ and ES futures Made money in 2 of 3 tests, 0 of them in both periods. Best: MNQ (Micro Nasdaq 100), 5-minute, +22%The strategy code we ran
This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.
class GapAndGo(Strategy):
"""Gap and go on US stock index futures: when the market opens with a gap and the
first candle moves the same way, trade the break of that candle in the gap's direction.
The gap is the difference between the price at 09:30 New York time, when the US stock
market opens, and the close at 16:00 New York time on the previous trading day (13:00
on a half day), as a % of that close. It is measured the same way as on the overnight
gap fill page, which trades the same gaps the other way.
Standard (all switches off): when the gap is at least 0.5% up and the first candle of
the session closes higher than it opened, place a buy stop order at that candle's
high, so the trade opens when price breaks above it. The first candle is the first
candle of the chart: 09:30 to 09:35 on a 5-minute chart, 09:30 to 09:31 on a 1-minute
chart. The stop-loss is the first candle's low, so the risk of the trade (1R) is the
candle's height. The take-profit is 2R above the entry. Mirror for a gap down of at
least 0.5% with a first candle that closes lower: a sell stop order at its low, the
stop-loss at its high, the take-profit 2R below. The order waits until 16:00 New York;
if price never breaks the candle by then, there is no trade that day. A trade still
open at 16:00 closes then. One trade a day at most. Size every trade so that the
stop-loss costs 1% of the account, in whole contracts; if one contract would risk
more, skip the day. No trading on days the New York Stock Exchange is closed or closes
early (13:00).
The changes, one at a time:
full_gap = 1 only full gaps: the 09:30 price is above the previous day's
09:30-16:00 high after a gap up, or below its low after a gap down
any_candle = 1 no first-candle rule: trade the break in the gap's direction
whichever way the first candle closed
hold = 1 no take-profit: only the stop-loss or the 16:00 close ends the trade
For comparison: min_gap_pct = 0 trades every day, whatever the size of the gap, and
candle_minutes = 5 on a 1-minute chart uses the first 5 minutes: the same trades as
the 5-minute chart, with a few fills at a candle's open landing at a different price.
"""
params = {"min_gap_pct": Param(type=float, default=0.5, min=0.0, max=10.0),
"exit_rr": Param(type=float, default=2.0, min=0.5, max=10.0),
"candle_minutes": Param(type=int, default=0, min=0, max=60),
"full_gap": Param(type=int, default=0, min=0, max=1),
"any_candle": Param(type=int, default=0, min=0, max=1),
"hold": Param(type=int, default=0, min=0, max=1)}
lookback = 2
session_open = 570 # 09:30 New York, in minutes after midnight
session_close = 960 # 16:00 New York
early_close = 780 # 13:00 New York, the close on a half day
# Days the New York Stock Exchange is closed, 2020-2025: no stock market open, no trade,
# and the next day's gap counts from the last close before them.
closed_days = (
"2020-01-01 2020-01-20 2020-02-17 2020-04-10 2020-05-25 2020-07-03 2020-09-07 2020-11-26 "
"2020-12-25 "
"2021-01-01 2021-01-18 2021-02-15 2021-04-02 2021-05-31 2021-07-05 2021-09-06 2021-11-25 "
"2021-12-24 "
"2022-01-17 2022-02-21 2022-04-15 2022-05-30 2022-06-20 2022-07-04 2022-09-05 2022-11-24 "
"2022-12-26 "
"2023-01-02 2023-01-16 2023-02-20 2023-04-07 2023-05-29 2023-06-19 2023-07-04 2023-09-04 "
"2023-11-23 2023-12-25 "
"2024-01-01 2024-01-15 2024-02-19 2024-03-29 2024-05-27 2024-06-19 2024-07-04 2024-09-02 "
"2024-11-28 2024-12-25 "
"2025-01-01 2025-01-09 2025-01-20 2025-02-17 2025-04-18 2025-05-26 2025-06-19 2025-07-04 "
"2025-09-01 2025-11-27 2025-12-25")
# Half days: the stock market closes at 13:00. No trade; the 13:00 close is the close
# the next day's gap counts from.
half_days = (
"2020-11-27 2020-12-24 2021-11-26 2022-11-25 2023-07-03 2023-11-24 "
"2024-07-03 2024-11-29 2024-12-24 2025-07-03 2025-11-28 2025-12-24")
def init(self, ctx):
self.ny = ctx.clock("America/New_York")
self.no_trading = set(self.closed_days.split())
self.half = set(self.half_days.split())
self.day = None
self.trading_day = False # True when today is a New York Stock Exchange trading day
self.prev_close = None # the previous trading day's close (16:00, or 13:00 on a half day)
self.prev_high = None # the previous trading day's 09:30-16:00 high
self.prev_low = None # ... and low
self.close_today = None # today's close, once the closing candle is in
self.high_today = None # today's high since 09:30
self.low_today = None # today's low since 09:30
self.price_0930 = None # the price at 09:30: the close of the candle that ends then
self.c_open = None # the first candle of the session: open, high, low, close
self.c_high = None
self.c_low = None
self.c_close = None
self.order = None # today's stop order, while it waits for the break
self.done = True # True once today's order is placed, or the day is skipped
def on_bar(self, ctx):
start = self.ny.minute_of_day # this candle's open, New York time
end = start + ctx.timeframe_minutes # this candle's close
if self.ny.date != self.day: # a new day
if self.trading_day: # the day that just ended becomes "the previous day"
self.prev_close = self.close_today # None if its closing candle was missing
self.prev_high, self.prev_low = self.high_today, self.low_today
self.day = self.ny.date
self.trading_day = self.ny.weekday < 5 and self.day not in self.no_trading
self.close_today = self.high_today = self.low_today = None
self.price_0930 = None
self.c_open = self.c_high = self.c_low = self.c_close = None
self.done = not self.trading_day or self.day in self.half
close_at = self.early_close if self.day in self.half else self.session_close
# Today's stock market session (09:30 to 16:00): its high, its low and its close.
if self.trading_day and self.session_open <= start < close_at:
self.high_today = ctx.high[0] if self.high_today is None else max(self.high_today, ctx.high[0])
self.low_today = ctx.low[0] if self.low_today is None else min(self.low_today, ctx.low[0])
if end == close_at:
self.close_today = ctx.close[0]
if ctx.position is not None:
self.order = None # the stop order has filled
if end >= self.session_close or start < self.session_open:
ctx.close_position() # still open at 16:00: closes at the 16:00 candle's open
return
if self.order is not None:
if end >= self.session_close or start < self.session_open:
ctx.cancel_order(self.order.order_id) # no break by 16:00: no trade today
self.order = None
return
if self.done:
return
if end == self.session_open: # the gap is measured at 09:30
self.price_0930 = ctx.close[0]
return
if start < self.session_open:
return
minutes = max(ctx.params.candle_minutes, ctx.timeframe_minutes)
candle_end = self.session_open + minutes
if start >= candle_end: # the first candle is missing (a gap in the data)
self.done = True
return
# The first candle: the chart's candles from 09:30 until 09:30 + its length.
if start == self.session_open:
self.c_open, self.c_high, self.c_low = ctx.open[0], ctx.high[0], ctx.low[0]
elif self.c_open is not None:
self.c_high = max(self.c_high, ctx.high[0])
self.c_low = min(self.c_low, ctx.low[0])
self.c_close = ctx.close[0]
if end < candle_end:
return
self.done = True # decided when the first candle closes
if not ctx.gate("previous_close_known", self.prev_close is not None and self.prev_high is not None):
return
if not ctx.gate("price_at_0930_known", self.price_0930 is not None and self.c_open is not None):
return
gap = self.price_0930 - self.prev_close # above zero: a gap up; below zero: a gap down
gap_pct = abs(gap) / self.prev_close * 100
if not ctx.gate("gap_at_least_0_5_pct", gap != 0 and gap_pct >= ctx.params.min_gap_pct):
return
up = gap > 0
if ctx.params.full_gap == 1 and not ctx.gate(
"full_gap_beyond_previous_day_range",
self.price_0930 > self.prev_high if up else self.price_0930 < self.prev_low):
return
if not ctx.gate("first_candle_not_flat", self.c_high > self.c_low):
return
if ctx.params.any_candle == 0 and not ctx.gate(
"first_candle_closes_with_gap",
self.c_close > self.c_open if up else self.c_close < self.c_open):
return
risk = self.c_high - self.c_low # 1R: the height of the first candle
entry = self.c_high if up else self.c_low
stop = self.c_low if up else self.c_high
size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
if not ctx.gate("one_contract_fits_1pct_risk", size > 0):
return # one contract would risk more than 1%
target = None
if ctx.params.hold == 0:
target = entry + ctx.params.exit_rr * risk if up else entry - ctx.params.exit_rr * risk
if up:
self.order = ctx.buy(size=size, stop=entry, sl=stop, tp=target, tag="gap_up_go")
else:
self.order = ctx.sell(size=size, stop=entry, sl=stop, tp=target, tag="gap_down_go")
Your turn
Test the gap and go strategy yourself
Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest a gap and go on MES, 5-minute chart: when the 09:30 New York price gaps at least 0.5% from the previous 16:00 close and the first 5-minute candle closes in the gap's direction, enter on a break of that candle, stop-loss at its other end, take-profit at 2R, close at 16:00
.
Free account. No credit card needed.
See every strategy we tested Browse strategies shared by tradersBacktest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 26 October 2026.