Overnight range breakout strategy
On ES futures from January 2016 to July 2026, the overnight range breakout made $10,914 after costs and made money in 4 of 11 years.
BreakoutIntraday1-minute barsBacktested Nov 6, 2026
Overnight range breakout backtest, the result
Contract
E-mini S&P 500
-
+$10.9K
Net after costs
After $69,299 in fees and slippage
-
4 of 11
Years that made money
January 2016 to July 2026
-
−$54.8K
Largest drawdown
Peak to trough, 1 contract
-
$4
Average trade
2,427 trades
Net after costs by month, January 2016 to July 2026.
Overnight range breakout rules
Let the overnight session set a range, then trade the day session's first close outside it.
A drawing of the rules on a made-up day, not a result.
- The overnight range is the high and low of the Globex session from its 18:00 New York open to the 9:30 open of the day session.
- In the day session, the first one-minute close above the range buys and the first below it sells short, once a day, until 15:00.
- The stop is the other side of the range.
- Whatever is still open is closed at 15:45 New York.
- Decides on
- 1-minute bars
- Holds
- Nothing overnight
- Parameters
- session minute 1,080, open minute 570, last entry 900, exit minute 945
Results by year
It made money in 4 of 11 years on ES. Its best year was 2025, +$30,565, and its worst 2022, −$14,477.
| Year | Net | Trades | Win rate | Drawdown | Buy and hold |
|---|---|---|---|---|---|
| 2016 | −$11,722 | 226 | 45% | −$16,416 | +$11,497 |
| 2017 | −$11,765 | 223 | 37% | −$13,033 | +$21,936 |
| 2018 | −$8,481 | 241 | 44% | −$17,104 | −$8,589 |
| 2019 | −$564 | 221 | 48% | −$9,633 | +$35,436 |
| 2020 | +$14,011 | 198 | 54% | −$15,044 | +$27,761 |
| 2021 | −$3,331 | 234 | 50% | −$15,307 | +$51,361 |
| 2022 | −$14,477 | 238 | 49% | −$32,250 | −$45,939 |
| 2023 | +$22,944 | 236 | 48% | −$11,806 | +$38,435 |
| 2024 | −$7,229 | 239 | 46% | −$35,650 | +$42,947 |
| 2025 | +$30,565 | 233 | 53% | −$23,483 | +$37,010 |
| 2026, Jan to Jul | +$963 | 138 | 52% | −$21,738 | +$24,355 |
Overnight range breakout backtest results
On ES it made $80,213 before costs. Fees and slippage took $69,299 of that.
- Net = before costs − fees − slippage
- ES: $80,213 − $8,624 − $60,675 = $10,914
The interval holds zero: this test cannot tell the average trade from no edge.
Overnight range breakout code and Pine Script
The strategy as the backtest ran it, and the Pine Script our compiler wrote from it for TradingView.
1from atlantive import BUY, NEW_YORK, SELL, Bars, Session, Strategy2 3 4class OvernightRangeBreakout(Strategy):5 """Overnight range breakout, New York day session.6 7 The overnight range is the high and low of the Globex session from its 18:00 New York open to8 the 9:30 open of the day session. In the day session, the first one-minute close above the range9 buys and the first below it sells short, once a day, until 15:00. The stop is the other side of10 the range, tested on every one-second close; whatever is still open at 15:45 is closed. The clock11 is one-second bars; the minute closes are built from them.12 """13 14 data = "bars"15 16 class Params:17 session_minute: int = 108018 open_minute: int = 57019 last_entry: int = 90020 exit_minute: int = 94521 clip: int = 122 23 class State:24 clock: Session(zone=NEW_YORK)25 bars: Bars(interval_ns=1_000_000_000)26 night_high: float27 night_low: float28 night_of: int29 minute_key: int30 minute_of: int31 minute_day: int32 minute_close: float33 traded_day: int34 35 def on_event(self, view, ev, orders):36 self.clock.update(ev)37 if not self.bars.update(ev):38 return39 minute = self.clock.prev_minute40 second = self.clock.prev_second41 day = self.clock.prev_day42 high = float(self.bars.prev_high)43 low = float(self.bars.prev_low)44 close = float(self.bars.prev_close)45 late = second + 1 >= self.p.exit_minute * 60 or day != self.traded_day46 if view.position > 0:47 if close <= self.night_low or late:48 orders.ioc(side=SELL, qty=self.p.clip)49 elif view.position < 0:50 if close >= self.night_high or late:51 orders.ioc(side=BUY, qty=self.p.clip)52 key = day * 1440 + minute53 if key != self.minute_key:54 m = self.minute_of55 in_window = m >= self.p.open_minute and m < self.p.last_entry56 if self.minute_key != 0 and in_window and view.position == 0:57 if self.night_of == self.minute_day and self.traded_day != self.minute_day:58 if self.minute_close > self.night_high:59 orders.ioc(side=BUY, qty=self.p.clip)60 self.traded_day = self.minute_day61 elif self.minute_close < self.night_low:62 orders.ioc(side=SELL, qty=self.p.clip)63 self.traded_day = self.minute_day64 self.minute_key = key65 self.minute_of = minute66 self.minute_day = day67 self.minute_close = close68 # The overnight session belongs to the day it ends on: 18:00 tonight is tomorrow's.69 night = day70 if minute >= self.p.session_minute:71 night = day + 172 if minute >= self.p.session_minute or minute < self.p.open_minute:73 if self.night_of != night:74 self.night_of = night75 self.night_high = high76 self.night_low = low77 else:78 self.night_high = max(self.night_high, high)79 self.night_low = min(self.night_low, low) 1//@version=62// OvernightRangeBreakout, exported from Atlantive.3// Chart simulation: decisions use completed bars; market orders fill at the next bar open.4// Native fills, fees, data gaps and session boundaries can differ. Re-test on the target symbol.5// Use standard time-based candles and the strategy's timeframe, not synthetic chart prices.6// Pine v6 trims old trade records at its order limit; the strategy keeps calculating.7// Margin is explicitly disabled to retain the native signal simulation's sizing.8strategy("OvernightRangeBreakout", overlay=true, initial_capital=100000.0, commission_type=strategy.commission.cash_per_contract, commission_value=1.68, default_qty_type=strategy.fixed, default_qty_value=1, calc_on_every_tick=false, process_orders_on_close=false, slippage=0, margin_long=0, margin_short=0)9 10if timeframe.in_seconds() != 111 runtime.error("OvernightRangeBreakout was exported for the 1 second timeframe; set the chart to 1S.")12 13session_minute = input.int(1080, "session_minute", minval=-9007199254740991, maxval=9007199254740991)14open_minute = input.int(570, "open_minute", minval=-9007199254740991, maxval=9007199254740991)15last_entry = input.int(900, "last_entry", minval=-9007199254740991, maxval=9007199254740991)16exit_minute = input.int(945, "exit_minute", minval=-9007199254740991, maxval=9007199254740991)17clip = input.int(1, "clip", minval=-9007199254740991, maxval=9007199254740991)18 19_q_safe_int(x) =>20 if math.abs(x) > 900719925474099121 runtime.error("an integer left the exact chart range; this run cannot be compared faithfully")22 int(x)23_q_int(x) => _q_safe_int(x < 0 ? math.ceil(x) : math.floor(x))24_q_iadd(a, b) => _q_safe_int(a + b)25_q_imul(a, b) =>26 if a != 0 and math.abs(b) > 9007199254740991 / math.abs(a)27 runtime.error("an integer multiplication left the exact chart range; this run cannot be compared faithfully")28 _q_safe_int(a * b)29 30_q_high = _q_int(math.round(high * 1000000000.0))31_q_low = _q_int(math.round(low * 1000000000.0))32_q_close = _q_int(math.round(close * 1000000000.0))33 34var float night_high = 0.035var float night_low = 0.036var int night_of = 037var int minute_key = 038var int minute_of = 039var int minute_day = 040var float minute_close = 0.041var int traded_day = 042// clock: completed chart bar's opening timestamp (America/New_York).43_q_clock_prev_minute = hour(time, "America/New_York") * 60 + minute(time, "America/New_York")44_q_clock_prev_second = _q_clock_prev_minute * 60 + second(time, "America/New_York")45_q_clock_prev_weekday = (dayofweek(time, "America/New_York") + 5) % 746_q_clock_prev_day = int(timestamp("UTC", year(time, "America/New_York"), month(time, "America/New_York"), dayofmonth(time, "America/New_York"), 0, 0) / 86400000)47// Current clock: this chart bar's scheduled close, known without a future bar.48// A native next event after a data gap can carry a later time.49_q_clock_minute = hour(time_close, "America/New_York") * 60 + minute(time_close, "America/New_York")50_q_clock_second = _q_clock_minute * 60 + second(time_close, "America/New_York")51_q_clock_weekday = (dayofweek(time_close, "America/New_York") + 5) % 752_q_clock_day = int(timestamp("UTC", year(time_close, "America/New_York"), month(time_close, "America/New_York"), dayofmonth(time_close, "America/New_York"), 0, 0) / 86400000)53_q_clock_seen = 154int minute_l = na55int second_l = na56int day = na57float high_l = na58float low_l = na59float close_l = na60bool late = false61int key = na62int m = na63bool in_window = false64int night = na65 66minute_l := _q_int(_q_clock_prev_minute)67second_l := _q_int(_q_clock_prev_second)68day := _q_int(_q_clock_prev_day)69high_l := _q_high * 1.070low_l := _q_low * 1.071close_l := _q_close * 1.072late := _q_iadd(second_l, 1) >= _q_imul(exit_minute, 60) or day != traded_day73if _q_int(strategy.position_size) > 074 if close_l <= night_low or late75 _q_qty1 = _q_int(clip)76 if _q_qty1 <= 077 runtime.error("market order quantity must be a positive whole unit")78 _q_pos1 = _q_int(strategy.position_size)79 if _q_pos1 < 0 or _q_pos1 > 0 and _q_qty1 < _q_pos180 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")81 strategy.order("q1", strategy.short, _q_qty1)82else if _q_int(strategy.position_size) < 083 if close_l >= night_high or late84 _q_qty2 = _q_int(clip)85 if _q_qty2 <= 086 runtime.error("market order quantity must be a positive whole unit")87 _q_pos2 = _q_int(strategy.position_size)88 if _q_pos2 > 0 or _q_pos2 < 0 and _q_qty2 < -_q_pos289 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")90 strategy.order("q2", strategy.long, _q_qty2)91key := _q_int(_q_iadd(_q_imul(day, 1440), minute_l))92if key != minute_key93 m := _q_int(minute_of)94 in_window := m >= open_minute and m < last_entry95 if minute_key != 0 and in_window and _q_int(strategy.position_size) == 096 if night_of == minute_day and traded_day != minute_day97 if minute_close > night_high98 _q_qty3 = _q_int(clip)99 if _q_qty3 <= 0100 runtime.error("market order quantity must be a positive whole unit")101 _q_pos3 = _q_int(strategy.position_size)102 if _q_pos3 > 0 or _q_pos3 < 0 and _q_qty3 < -_q_pos3103 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")104 strategy.order("q3", strategy.long, _q_qty3)105 traded_day := _q_int(minute_day)106 else if minute_close < night_low107 _q_qty4 = _q_int(clip)108 if _q_qty4 <= 0109 runtime.error("market order quantity must be a positive whole unit")110 _q_pos4 = _q_int(strategy.position_size)111 if _q_pos4 < 0 or _q_pos4 > 0 and _q_qty4 < _q_pos4112 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")113 strategy.order("q4", strategy.short, _q_qty4)114 traded_day := _q_int(minute_day)115 minute_key := _q_int(key)116 minute_of := _q_int(minute_l)117 minute_day := _q_int(day)118minute_close := close_l119night := _q_int(day)120if minute_l >= session_minute121 night := _q_int(_q_iadd(day, 1))122if minute_l >= session_minute or minute_l < open_minute123 if night_of != night124 night_of := _q_int(night)125 night_high := high_l126 night_low := low_l127 else128 night_high := math.max(night_high, high_l)129 night_low := math.min(night_low, low_l) How it was tested
The published rules, never tuned on the data, with real costs on every fill. Every strategy here is tested the same way.
- Market data
- CME Globex 1-minute bars, Jan 2, 2016 to Jul 31, 2026
- Rules
- As published, with the published parameters, never tuned on this data
- Size
- 1 contract on every trade
- Contract
- The most traded one, rolled as the market moved
- Fees
- The broker's $0.50 a side, plus CME's and the NFA's fees when the window opens
- Slippage
- 1 tick a side on ES, 2 in NQ's regular session and 3 outside it, 1 on other markets, where it was not measured
- Stops and entries
- Tested on 1-second closes and filled at the next bar
- Contracts traded
- ES: 43 contracts, ESH6 to ESU6NQ: 43 contracts, NQH6 to NQU6
- Costs paid
- ES: $8,624 in fees, $60,675 in slippageNQ: $8,937 in fees, $50,610 in slippage
- Warm-up
- None: each contract reads only its own bars
- Flagged days
- ES: NoneNQ: None Days the data holds too few bars for. Flagged, not removed.
Could you pass
a prop firm challenge
with the overnight range breakout?
A backtest says whether a strategy makes money. Our AI runs its trades through the rules of every prop firm account, then tells you which one it would pass and at what size.
No card needed. Free credits every month.
- Most money: Blue Guardian Futures Direct 50K, $5,084
- Best payout odds: Funded Futures Family Straight to Funded 50K, 98%
- Fastest pass: Phidias Express to Live 50K, 11 days
$5,084
Median net across 2,000 simulated runs
- Evaluation
- None
- First payout
- 97%
- Fees paid
- $1,521
Median net across 2,000 simulated runs
Questions about the overnight range breakout
What is the overnight range breakout?
Let the overnight session set a range, then trade the day session's first close outside it. Atlantive backtested it on CME futures from January 2016 to July 2026 after costs.
Is the overnight range breakout profitable on ES futures?
In this backtest it made money: on ES futures from January 2016 to July 2026 it made $10,914 after costs, over 2,427 trades, positive in 4 of 11 years; on NQ it made $140,638. Buying and holding one ES contract over the same window made $236,212. The average trade was $4, its 95% interval −$48 to $59. These are hypothetical results of a backtest, not of trading.
What are the overnight range breakout's rules?
The overnight range is the high and low of the Globex session from its 18:00 New York open to the 9:30 open of the day session. In the day session, the first one-minute close above the range buys and the first below it sells short, once a day, until 15:00. The stop is the other side of the range. Whatever is still open is closed at 15:45 New York. Its parameters are the published ones, never tuned on the data it was tested on.
How was the overnight range breakout backtested?
On CME Globex data from January 2016 to July 2026, one contract, on 1-minute bars, rolled to the most traded contract as the market moved, with the broker's and CME's fees and the slippage measured on each market. Stops and entries were tested on 1-second closes and filled at the next bar. Nothing was fitted to the data.
Can I run the overnight range breakout in TradingView?
Yes. The page carries its Pine Script, written by Atlantive's compiler from the same code the backtest ran, for TradingView's strategy tester. A chart's fills and fees can differ from the backtest's, so test it again on the symbol you trade.
Can I change the overnight range breakout and test it again?
Yes. Rerun it in Atlantive: a new chat opens with the strategy's rules in the box, for you to read, change and send. The agent writes the code, backtests it on the market and window you name, and reports the result with its costs.