Strategies we backtested New York open breakout

Tested by BacktestingMax

New York open breakout backtest on NQ, ES and gold futures

Does the New York open breakout strategy work on NQ and ES futures?

No. With its basic rules, the New York open breakout lost money in all 10 of our backtests from 2020 to 2025, after trading costs. We tested MNQ and MES (the micro contracts of NQ and ES), MGC (micro gold), YM (Dow) and RTY (Russell 2000), each on 5-minute and 15-minute charts. The strategy marks the range from 08:00 to 08:30 New York time, an hour before the stock market opens. It buys when a candle closes above the range and sells short when one closes below it. The stop-loss is at the other side of the range, the take-profit at 2 times the distance to the stop-loss (2R), and trades close by 12:00. Each trade risked 1% of the account, which started at $50,000. The account lost 5.5% in the best test (RTY, 15-minute chart) and 74.6% in the worst (MES, 5-minute chart). Most losses came on days with a main US report at 08:30, like the weekly jobless claims, the jobs report or CPI. We also tested four common changes. Only one of all 50 tests made money in both 2020–2023 and 2024–2025.

10 backtests 2020–2025 Trading costs included Tested 19 October 2026

Where it worked 10 backtests
Made money
0
of 10 tests, with the basic rules
Made money in both periods
0
2020–2023 and again 2024–2025
Best backtest
−6%
RTY (Russell 2000 futures), 15-minute chart: account growth 2020–2025
Narrow-range days only
0
tests made money in both periods, compared with 0 with the basic rules

Lost money on every market

  • 5-minute charts
  • 15-minute charts

The results

Results on every market

Each box shows one backtest of the New York open breakout 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 5-minute 15-minute
MNQ (Micro Nasdaq 100) −35% Lost money −28% Lost money
MES (Micro S&P 500) −75% Lost money −60% Lost money
MGC (Micro Gold) −16% Lost money −21% Lost money
YM (Dow futures) −10% Lost money −30% Lost money
RTY (Russell 2000 futures) −8% Lost money −6% Lost money
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) 5-minute 1,481 35.6% 0.95 −35.4% −44.0% −4.2% −32.6% −62.7% $14,795
MNQ (Micro Nasdaq 100) 15-minute 1,479 36.4% 0.96 −27.5% −38.9% 0.0% −27.5% −59.7% $13,762
MES (Micro S&P 500) 5-minute 1,463 35.3% 0.86 −74.6% −75.8% −52.9% −46.1% −81.2% $25,240
MES (Micro S&P 500) 15-minute 1,485 37.4% 0.91 −60.1% −60.5% −22.1% −48.8% −73.2% $29,190
MGC (Micro Gold) 5-minute 1,498 41.5% 0.97 −16.2% −36.3% −16.4% +0.2% −53.9% $19,970
MGC (Micro Gold) 15-minute 1,479 42.5% 0.96 −20.8% −40.1% −20.9% +0.1% −52.6% $17,520
YM (Dow futures) 5-minute 1,111 35.3% 0.98 −10.1% −27.0% −4.1% −6.2% −47.0% $16,263
YM (Dow futures) 15-minute 913 34.1% 0.92 −30.4% −31.0% −21.9% −10.9% −51.2% $11,390
RTY (Russell 2000 futures) 5-minute 1,227 35.3% 0.99 −7.8% −33.9% +15.5% −20.2% −49.4% $19,343
RTY (Russell 2000 futures) 15-minute 1,161 37% 0.99 −5.5% −36.2% +38.5% −31.7% −47.0% $17,530

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

Best test RTY (Russell 2000 futures), 15-minute chart −5.5% from 2020 to 2025
Middle test (median): half of the 10 did better, half did worse MGC (Micro Gold), 15-minute chart −20.8% from 2020 to 2025

What we found

What the 10 backtests show

  1. Before trading costs, 5 of the 10 tests made money (MGC and RTY on both charts, and YM on the 5-minute chart), but in each of them the trading costs were bigger than that profit.

  2. Most of the losses came on days with one of the main US reports at 08:30 New York time, right when the range ends. We tracked 7 reports: the jobs report, CPI, PPI and core PCE (inflation reports), retail sales (spending), GDP (growth) and the weekly jobless claims (new claims for unemployment pay). Of the 1,508 trading days, 578 had at least one of them. The trades on those days lost money in all 10 tests. In every test, they did worse than the trades on the other days, in total and per trade. In the results below, R is a unit: 1R is 1% of the account at the time of the trade, the amount each trade was sized to risk. All 10 tests together, the 4,834 trades on report days lost 366.1R, and they lost money in every year from 2020 to 2025. The 8,463 trades on the other days made +44.4R (see the chart below).

  3. No test with the basic rules made money in both 2020–2023 and 2024–2025. A result for 2020–2023 or 2024–2025 is the change in the account during those years. On the index futures (MNQ, MES, YM and RTY, each on two charts), 2 of the 8 tests made money in 2020–2023, and none in 2024–2025. The 2 were RTY: +15.5% on the 5-minute chart and +38.5% on the 15-minute chart. Both lost money in 2024–2025: −20.2% and −31.7%. Gold did the opposite. MGC lost 16.4% (5-minute chart) and 20.9% (15-minute chart) in 2020–2023, then ended 2024–2025 about even: +0.2% and +0.1%.

  4. We also tested four common changes to the rules, each on the same 10 tests (50 tests in all, counting the basic rules). The biggest gains came from holding each trade until 12:00, with no take-profit: +119.9% on MNQ's 15-minute chart and +36.9% on its 5-minute chart, from 2020 to 2025. These gains came in 2020–2023, when the account grew 157.8% and 94.7%. In 2024–2025, MNQ lost money with this exit (−14.7% and −29.7%), so the totals for 2020–2025 are smaller. A one-hour range, from 08:00 to 09:00, made money on MGC on both charts from 2020 to 2025: +16.1% (5-minute chart) and +9.5% (15-minute chart). On the 15-minute chart, it made money in both 2020–2023 (+3.4%) and 2024–2025 (+5.8%), the only one of the 50 tests that did. But we picked out this test after seeing both periods, it made only a little, and it did not pass all four of our checks.

The 08:30 reports

Trades on US report days lost money

Each bar adds up the results of all the trades on one kind of day, in all 10 tests with the basic rules, from 2020 to 2025, after trading costs. The results are in R: 1R is 1% of the account at the time of the trade. A day with more than one report counts once, in the highest group on the chart that fits it. For example, a Thursday with CPI and the jobless claims counts as a CPI day.

  • Jobs report days511 trades −52.6R
  • CPI days488 trades −30.8R
  • PPI, retail sales, GDP or core PCE days2,262 trades −111.0R
  • Days with only the weekly jobless claims (a Thursday report)1,573 trades −171.6R
  • Days with none of these reports8,463 trades +44.4R

The losses on report days are not only about Thursdays, when the weekly jobless claims come out. On Tuesdays, Wednesdays and Fridays too, the trades on report days did worse per trade than the trades on the same weekday without these reports. Mondays almost never have these reports (16 trades), so we left them out of this comparison. Per trade, report days averaged −0.08R, and the other days +0.01R. The report days also lost money with each of the four changes we tested (2020–2025, all 10 tests together). We did not test a version that skips these days. The report dates come from the economic calendar in BacktestingMax.

Every version

Each version on each market, 2020–2025

Each cell is the change in the account from 2020 to 2025, after trading costs, risking 1% of the account per trade. The first result column is the basic rules. Each of the other four columns adds one change to them, explained under 'Can the New York open breakout be improved?' below.

Market Chart Basic rules Hold until 12:00 (no take-profit) One-hour range (08:00 to 09:00) Wait until 08:45 Narrow-range days only
MNQ 5-minute −35.4% +36.9% −34.0% −22.0% −15.1%
MNQ 15-minute −27.5% +119.9% −14.9% −38.4% −9.6%
MES 5-minute −74.6% −43.0% −65.7% −72.5% −31.0%
MES 15-minute −60.1% −4.4% −41.8% −63.1% +3.0%
MGC 5-minute −16.2% −21.3% +16.1% −10.5% −17.2%
MGC 15-minute −20.8% −9.0% +9.5% −30.4% −3.7%
YM 5-minute −10.1% −26.7% −36.5% −28.2% −8.3%
YM 15-minute −30.4% −36.1% −23.5% −27.8% −28.4%
RTY 5-minute −7.8% −18.3% −21.3% −9.1% +4.0%
RTY 15-minute −5.5% +18.3% −9.9% −30.9% +0.8%

In 2024–2025 alone, the index futures (MNQ, MES, YM and RTY) lost money in 39 of their 40 tests in this table (4 markets, 2 charts, 5 versions). The only exception was the one-hour range on MNQ's 15-minute chart (+11.8%). MGC made money in 9 of its 10 tests in 2024–2025, but with the basic rules only just (+0.2% and +0.1%). On YM and RTY, the one-hour range traded on far fewer days (35% to 49% of them). A bigger range puts the stop-loss further away, so one contract more often risked more than 1% of the account.

The strategy

What the New York open breakout is

In futures trading, "the New York open" can mean two times. On many days, the main US economic reports come out at 08:30 New York time, like the jobs report and CPI. At 09:30, the US stock market opens. This strategy uses 08:30. The range is the highest and the lowest price from 08:00 to 08:30 New York time. A breakout is a candle that closes outside the range. A common way to trade it: buy when a candle closes above the range, and sell short (sell first, to profit if price falls) when a candle closes below it. Traders expect the move that breaks the range to keep going. For a range that starts at 09:30, see the 5-minute opening range breakout under 'Related strategies we tested', at the bottom of this page. We tested 5 futures markets. MNQ (Micro Nasdaq 100) and MES (Micro S&P 500) follow the same prices as NQ and ES, so their breakouts are the same, but one contract is one tenth of the size. MGC (Micro Gold) is one tenth of the GC gold contract. YM (Dow) and RTY (Russell 2000) are the larger E-mini contracts, ten times the size of their micro versions (MYM and M2K), which are not in our data. On YM and RTY, the backtest skipped the days when even one contract would have risked more than 1% of the account, because the stop-loss was too far away. Depending on the chart, YM traded on 61% to 74% of the trading days, and RTY on 77% to 81%. So their results do not compare directly with MNQ, MES and MGC.

Range
08:00 to 08:30 New York time, the half hour before 08:30, when US reports come out on many days
Breakout
A candle closes above the range high (buy) or below the range low (sell), from 08:30 until 12:00 New York time
Stop-loss
The other side of the range
Take-profit
2R: 2 times the distance from the breakout candle's close to the stop-loss. A trade still open at 12:00 New York time closes then.
Trades per day
1 at most: the first breakout
Risk per trade
1% of the account, rounded down to whole contracts
Fills
The stop-loss fills at its price, or at a candle's open if price opens past it. The take-profit fills at its exact price. When price reaches both 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
BacktestingMax's futures data. It is built from CFD prices (a broker's price that follows the same market) and adjusted 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 gap between the buy and the sell price. We used 1 tick: half is paid when a trade opens, and half when it closes. A trade that closes at the take-profit pays no spread on the close, because the take-profit fills at its exact price. There is also a commission when a trade opens and again when it closes: $0.62 per MNQ, MES or MGC contract, and $2.50 per YM or RTY contract.

The rules we tested

  1. Each trading day, mark the range: the highest and the lowest price from 08:00 to 08:30 New York time. On the 5-minute chart, the range is the 6 candles from 08:00 to 08:30. On the 15-minute chart, it is 2 candles.
  2. After 08:30, buy when a candle closes above the range high. Sell (go short) when a candle closes below the range low. The trade opens at the next candle's open. A breakout counts on any candle that closes before 12:00 New York time.
  3. Put the stop-loss at the other side of the range: at the range low for a buy, and at the range high for a sell.
  4. R is the risk of the trade: the distance from the close of the breakout candle to the stop-loss. Put the take-profit 2R from that close, in the direction of the trade.
  5. If the trade is still open at 12:00 New York time, close it then.
  6. Take only the first breakout of the day, win or lose. After that trade, wait for the next day.
  7. Size every trade so that a loss at the stop-loss costs 1% of the account balance at that time. 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.
  8. Don't trade on days the New York Stock Exchange is closed (US holidays).

The method

How we tested it

The test

Markets
MNQ (Micro Nasdaq 100), MES (Micro S&P 500), MGC (Micro Gold), YM (Dow futures) and RTY (Russell 2000 futures)
Charts
5-minute and 15-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 New York open breakout be improved?

Besides the basic rules, we tested four changed versions of the New York open breakout, each with one change that traders often make: holding until 12:00 with no take-profit, a one-hour range from 08:00 to 09:00, waiting until 08:45, and trading only on narrow-range days. Each version was tested on the same 5 markets and 2 charts (10 tests). We picked the best version using 2020–2023 only: the one that made money in the most tests, and in a tie, the one with the better middle result (the median of the 10 tests). A version picked and judged on the same years almost always looks better than it really is, so we then checked it on 2024–2025, the years we did not use to pick it.

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 listed under 'The rules we tested', above: the range from 08:00 to 08:30, the stop-loss at the other side of the range, a 2R take-profit, and a close at 12:00. 2 of 10middle test −10.3% 2 of 10middle test −23.9% 0 0
Hold until 12:00 (no take-profit) No take-profit. The trade ends at the stop-loss, or at 12:00 New York time. Some traders hold a breakout through the whole morning, because a strong move can go much further than 2R. 4 of 10middle test −2.6% 2 of 10middle test −12.7% 0 0
One-hour range (08:00 to 09:00) Use the whole hour from 08:00 to 09:00 New York time as the range, instead of 08:00 to 08:30. On report days, the 08:30 report then comes out inside the range. A breakout counts from 09:00. The stop-loss is at the other side of this bigger range, so a 1% risk allows fewer contracts. 1 of 10middle test −12.5% 3 of 10middle test −17.5% 1 0
Wait until 08:45 Ignore the first 15 minutes after 08:30. Only a candle that opens at 08:45 or later can be the breakout. If price is already outside the range by then, the first candle from 08:45 that closes outside the range is the breakout, and the trade opens at the next candle's open. 2 of 10middle test −18.8% 1 of 10middle test −29.5% 0 0
Narrow-range days onlyBest on 2020–2023 Trade only on days when the range (08:00 to 08:30) is smaller than the average size of this range over the previous 20 trading days. Some traders expect a narrow range to break out more strongly. A narrow range also puts the stop-loss closer, so a 1% risk allows more contracts. 6 of 10middle test +6.3% 2 of 10middle test −17.8% 0 0

Not reliably. With the four changes, only one of the 40 tests made money in both 2020–2023 and 2024–2025. The version we picked using 2020–2023, narrow-range days only, did not keep working in 2024–2025. In 2020–2023, it made money in 6 of 10 tests, compared with 2 of 10 with the basic rules. In 2024–2025, it made money in 2 of 10 tests, the same as the basic rules, and no test made money in both periods with it. From 2020 to 2025, it made money in 3 of 10 tests, by +4.0% at most (RTY, 5-minute chart). On the index futures, the four changes did not help in 2024–2025: 31 of their 32 tests lost money. The one exception was the one-hour range on MNQ's 15-minute chart (+11.8%). Holding until 12:00 gave the biggest gains (+119.9% and +36.9% on MNQ), but these gains all came in 2020–2023. The one-hour range made money on MGC on both charts from 2020 to 2025, and its MGC 15-minute test is the one test that made money in both periods, but only by a little. We picked it out after seeing both periods, and it did not pass all four of our checks. Waiting until 08:45 was the only change that lost money in all 10 tests, the same as the basic rules.

Questions

Questions traders ask

Does the New York open breakout strategy work?

Not in our backtest. From 2020 to 2025, after trading costs, the basic rules lost money in all 10 tests: MNQ, MES, MGC, YM and RTY futures, each on a 5-minute and a 15-minute chart, risking 1% of the account per trade. In the best test, RTY on the 15-minute chart, the account lost 5.5%. Most of the losses came on days with one of the main US reports at 08:30, like the weekly jobless claims, the jobs report or CPI. We also tested four changes to the rules, each on the same 10 tests (50 tests in all). Only one of the 50 made money in both 2020–2023 and 2024–2025: MGC on the 15-minute chart, with a range from 08:00 to 09:00, and only by a little.

Does the New York open breakout work on NQ?

Not with the basic rules, in our backtest. We tested MNQ, the micro contract that follows the same price as NQ. From 2020 to 2025, the account lost 35.4% on the 5-minute chart and 27.5% on the 15-minute chart. Most of the loss came in 2024–2025: −32.6% on the 5-minute chart, and on the 15-minute chart, all of it (−27.5%). Holding each trade until 12:00, with no take-profit, made +36.9% (5-minute chart) and +119.9% (15-minute chart) from 2020 to 2025, the best results in this backtest. But these gains all came in 2020–2023. In 2024–2025, MNQ lost money with that exit too: −29.7% (5-minute chart) and −14.7% (15-minute chart).

Should you trade the New York open breakout on news days?

In our backtest, no: news days were the strategy's worst days. On days with one of the main US reports at 08:30 New York time (the jobs report, CPI, PPI, core PCE, retail sales, GDP or the weekly jobless claims), the trades lost money in all 10 tests. All 10 tests together, they lost 366.1R in 4,834 trades, where 1R is 1% of the account. The trades on the other days made +44.4R in 8,463 trades. Waiting until 08:45 before taking a breakout did not help: that version lost money in all 10 tests. We did not test a version that skips news days.

Does the New York open breakout work on gold?

Not with the basic rules, in our backtest. On MGC (micro gold futures), the account lost 16.2% on the 5-minute chart and 20.8% on the 15-minute chart from 2020 to 2025, all of it in 2020–2023. With a one-hour range, from 08:00 to 09:00, the account grew 16.1% (5-minute chart) and 9.5% (15-minute chart) from 2020 to 2025. On the 15-minute chart, this version made money in both 2020–2023 (+3.4%) and 2024–2025 (+5.8%), the only one of our 50 tests (5 versions on the same 10 tests) that did. In that test, the max drawdown (the biggest fall from the highest balance) was 17.6%. But we picked out this result after seeing both periods, the gains were small, and it did not pass all four of our checks.

Keep exploring

Related strategies we tested

Sessions London breakout strategy backtest on forex and gold Made money in 5 of 18 tests, 4 of them in both periods. Best: USD/JPY, 5-minute, +43% Opening range breakout 15-minute opening range breakout backtest on NQ and ES futures Made money in 9 of 12 tests, 8 of them in both periods. Best: MNQ (Micro Nasdaq 100), 5-minute, +158% Opening range breakout 5-minute opening range breakout backtest on NQ and ES futures Made money in 5 of 8 tests, 2 of them in both periods. Best: MNQ (Micro Nasdaq 100), 5-minute, +31%
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 NewYorkOpenBreakout(Strategy):
    """The New York open breakout on futures: the range from 08:00 to 08:30 New York time,
    and the first breakout of it before noon.
    The range is the highest and the lowest price from 08:00 to 08:30 New York time
    (daylight saving included). On many days, US economic reports (the jobs report, CPI,
    the weekly jobless claims...) come out at 08:30, so the range is the half hour before
    them. On a 5-minute chart the range is 6 candles; on a 15-minute chart, 2.
    Standard (all switches off): after 08:30, the first candle that closes above the range
    high is a buy, and the first candle that closes below the range low is a sell (go
    short). The trade opens at the next candle's open. The stop-loss sits at the other side
    of the range: the range low for a buy, the range high for a sell. The take-profit sits
    2 times the risk away (2R), the risk being the distance from the breakout candle's
    close to the stop-loss. A trade still open at 12:00 New York closes then, and a
    breakout only counts on a candle that closes before 12:00. One trade a day: the first
    breakout, win or lose. Size every trade so that the stop-loss costs 1% of the account;
    if one contract would risk more, skip the day. No trading on days the New York Stock
    Exchange is closed.
    The changes, one at a time:
      hold          = 1   no take-profit: only the stop-loss or 12:00 ends the trade
      range_minutes = 60  the range is the whole hour from 08:00 to 09:00, so an 08:30
                          report comes out inside the range; breakouts count from 09:00
      wait_news     = 1   wait 15 minutes after 08:30: only a candle that opens at 08:45
                          or later can be the breakout
      narrow        = 1   only trade when today's range is narrower than the average range
                          of the previous 20 trading days
    """
    params = {"range_minutes": Param(type=int, default=30, min=5, max=120),
              "exit_rr": Param(type=float, default=2.0, min=0.5, max=10.0),
              "hold": Param(type=int, default=0, min=0, max=1),
              "wait_news": Param(type=int, default=0, min=0, max=1),
              "narrow": Param(type=int, default=0, min=0, max=1)}
    lookback = 2
    range_start = 480     # 08:00 New York, in minutes after midnight
    exit_time = 720       # 12:00 New York
    average_days = 20     # the narrow-range filter compares with this many previous days
    # Days the New York Stock Exchange is closed, 2020-2025 (US holidays): no US data and
    # thin trading, so no trade.
    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")
    def init(self, ctx):
        self.ny = ctx.clock("America/New_York")
        self.no_trading = set(self.closed_days.split())
        self.day = None
        self.high = None          # the range high
        self.low = None           # the range low
        self.has_start = False    # True once the 08:00 candle has been seen today
        self.counted = False      # True once today's range is in the history
        self.past_ranges = []     # the range heights of the previous trading days, newest last
        self.done = True          # True once today's trade has been 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
        range_end = self.range_start + ctx.params.range_minutes
        if self.ny.date != self.day:               # a new day: forget yesterday's range
            self.day = self.ny.date
            self.high = self.low = None
            self.has_start = self.counted = False
            self.done = self.day in self.no_trading
        if ctx.position is not None:
            if end >= self.exit_time or start < self.range_start:
                ctx.close_position()               # fills at the 12:00 candle's open
            return
        # Build the range from the candles that open from 08:00 to 08:30.
        if self.range_start <= start < range_end:
            if start == self.range_start:
                self.has_start = True
            self.high = ctx.high[0] if self.high is None else max(self.high, ctx.high[0])
            self.low = ctx.low[0] if self.low is None else min(self.low, ctx.low[0])
            return
        if self.done or start < range_end or end >= self.exit_time:
            return
        if not ctx.gate("full_range", self.has_start and self.high is not None and self.high > self.low):
            self.done = True
            return
        height = self.high - self.low
        if not self.counted:                       # the first candle after the range
            self.counted = True
            average = (sum(self.past_ranges) / len(self.past_ranges)
                       if len(self.past_ranges) >= self.average_days else None)
            self.past_ranges = (self.past_ranges + [height])[-self.average_days:]
            if ctx.params.narrow == 1 and not ctx.gate("narrower_than_average",
                                                       average is not None and height < average):
                self.done = True                   # a wide range (or not 20 days yet): no trade today
                return
        if ctx.params.wait_news == 1 and not ctx.gate("after_0845", start >= range_end + 15):
            return                                 # still inside the first 15 minutes after 08:30
        close = ctx.close[0]
        up = close > self.high
        down = close < self.low
        if not ctx.gate("range_break", up or down):
            return
        self.done = True                           # one trade a day: this breakout is it
        stop = self.low if up else self.high
        risk = abs(close - stop)
        size = ctx.size_by_risk_pct(0.01, stop=stop, entry=close)
        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 = close + ctx.params.exit_rr * risk if up else close - ctx.params.exit_rr * risk
        if up:
            ctx.buy(size=size, sl=stop, tp=target, tag="ny_open_long")
        else:
            ctx.sell(size=size, sl=stop, tp=target, tag="ny_open_short")

Your turn

Test the New York open breakout yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the New York open breakout on MNQ, 5-minute chart: range 08:00 to 08:30 New York time, trade the first candle close outside it, stop-loss at the other side of the range, 2R take-profit, close at 12:00.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 19 October 2026.