Inside day breakout strategy
On ES futures from January 2016 to July 2026, the inside day breakout lost $74,621 after costs and made money in 2 of 11 years.
BreakoutIntradayDaily barsBacktested Nov 6, 2026
Inside day breakout backtest, the result
Contract
E-mini S&P 500
-
−$74.6K
Net after costs
After $8,733 in fees and slippage
-
2 of 11
Years that made money
January 2016 to July 2026
-
−$87.8K
Largest drawdown
Peak to trough, 1 contract
-
−$244
Average trade
306 trades
Net after costs by month, January 2016 to July 2026.
Inside day breakout rules
When a day trades inside the day before it, trade the next day's break above its high or below its low.
A drawing of the rules on a made-up day, not a result.
- An inside day has a lower high and a higher low than the CME trading day before it (18:00 to 17:00 New York).
- The next trading day the first one-second close above the inside day's high buys and the first below its low sells short, once.
- The position is closed in that day's last minute, from 16:59 New York.
- Decides on
- Daily bars
- Holds
- Nothing overnight
- Parameters
- session minute 1,080, exit second 61,140
Results by year
It made money in 2 of 11 years on ES. Its best year was 2025, +$10,649, and its worst 2024, −$13,305.
| Year | Net | Trades | Win rate | Drawdown | Buy and hold |
|---|---|---|---|---|---|
| 2016 | −$8,870 | 32 | 38% | −$10,724 | +$11,497 |
| 2017 | −$3,834 | 36 | 36% | −$4,370 | +$21,936 |
| 2018 | −$789 | 30 | 53% | −$9,251 | −$8,589 |
| 2019 | +$6,313 | 33 | 58% | −$3,425 | +$35,436 |
| 2020 | −$4,031 | 27 | 41% | −$25,038 | +$27,761 |
| 2021 | −$7,339 | 29 | 48% | −$17,126 | +$51,361 |
| 2022 | −$12,081 | 19 | 53% | −$16,641 | −$45,939 |
| 2023 | −$5,309 | 23 | 35% | −$9,096 | +$38,435 |
| 2024 | −$13,305 | 31 | 48% | −$25,425 | +$42,947 |
| 2025 | +$10,649 | 30 | 60% | −$16,791 | +$37,010 |
| 2026, Jan to Jul | −$36,023 | 16 | 25% | −$41,469 | +$24,355 |
Inside day breakout backtest results
On ES it lost $65,888 before costs, then paid $8,733 in fees and slippage.
- Net = before costs − fees − slippage
- ES: −$65,888 − $1,083 − $7,650 = −$74,621
The whole interval is under zero: after costs, the average trade lost money.
Inside day 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 InsideDayBreakout(Strategy):5 """Inside day breakout: after a day inside the one before it, trade the break of its range.6 7 A day is the CME trading day, 18:00 to 17:00 New York, built from one-second bars. An inside day8 has a lower high and a higher low than the day before it. The next trading day the first9 one-second close above the inside day's high buys and the first close below its low sells10 short, once. The position is closed in that day's last minute, from 16:59 New York, the nearest11 the bar lane comes to its close.12 """13 14 data = "bars"15 16 class Params:17 session_minute: int = 108018 exit_second: int = 6114019 clip: int = 120 21 class State:22 clock: Session(zone=NEW_YORK)23 bars: Bars(interval_ns=1_000_000_000)24 day_key: int25 day_high: float26 day_low: float27 last_high: float28 last_low: float29 days: int30 armed_day: int31 buy_level: float32 sell_level: 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 trade_day = day46 if minute >= self.p.session_minute:47 trade_day = day + 148 closing = second + 1 >= self.p.exit_second and minute < self.p.session_minute49 if view.position != 0:50 if closing or trade_day != self.traded_day:51 if view.position > 0:52 orders.ioc(side=SELL, qty=abs(view.position))53 else:54 orders.ioc(side=BUY, qty=abs(view.position))55 if trade_day != self.day_key:56 if self.day_key != 0:57 if self.days > 0 and self.day_high < self.last_high and self.day_low > self.last_low:58 self.armed_day = trade_day59 self.buy_level = self.day_high60 self.sell_level = self.day_low61 self.last_high = self.day_high62 self.last_low = self.day_low63 self.days += 164 self.day_key = trade_day65 self.day_high = high66 self.day_low = low67 else:68 self.day_high = max(self.day_high, high)69 self.day_low = min(self.day_low, low)70 if view.position == 0 and self.armed_day == trade_day and self.traded_day != trade_day and not closing:71 if close > self.buy_level:72 orders.ioc(side=BUY, qty=self.p.clip)73 self.traded_day = trade_day74 elif close < self.sell_level:75 orders.ioc(side=SELL, qty=self.p.clip)76 self.traded_day = trade_day 1//@version=62// InsideDayBreakout, 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("InsideDayBreakout", 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("InsideDayBreakout was exported for the 1 second timeframe; set the chart to 1S.")12 13session_minute = input.int(1080, "session_minute", minval=-9007199254740991, maxval=9007199254740991)14exit_second = input.int(61140, "exit_second", minval=-9007199254740991, maxval=9007199254740991)15clip = input.int(1, "clip", minval=-9007199254740991, maxval=9007199254740991)16 17_q_safe_int(x) =>18 if math.abs(x) > 900719925474099119 runtime.error("an integer left the exact chart range; this run cannot be compared faithfully")20 int(x)21_q_int(x) => _q_safe_int(x < 0 ? math.ceil(x) : math.floor(x))22_q_iadd(a, b) => _q_safe_int(a + b)23 24_q_high = _q_int(math.round(high * 1000000000.0))25_q_low = _q_int(math.round(low * 1000000000.0))26_q_close = _q_int(math.round(close * 1000000000.0))27 28var int day_key = 029var float day_high = 0.030var float day_low = 0.031var float last_high = 0.032var float last_low = 0.033var int days = 034var int armed_day = 035var float buy_level = 0.036var float sell_level = 0.037var int traded_day = 038// clock: completed chart bar's opening timestamp (America/New_York).39_q_clock_prev_minute = hour(time, "America/New_York") * 60 + minute(time, "America/New_York")40_q_clock_prev_second = _q_clock_prev_minute * 60 + second(time, "America/New_York")41_q_clock_prev_weekday = (dayofweek(time, "America/New_York") + 5) % 742_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)43// Current clock: this chart bar's scheduled close, known without a future bar.44// A native next event after a data gap can carry a later time.45_q_clock_minute = hour(time_close, "America/New_York") * 60 + minute(time_close, "America/New_York")46_q_clock_second = _q_clock_minute * 60 + second(time_close, "America/New_York")47_q_clock_weekday = (dayofweek(time_close, "America/New_York") + 5) % 748_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)49_q_clock_seen = 150int minute_l = na51int second_l = na52int day = na53float high_l = na54float low_l = na55float close_l = na56int trade_day = na57bool closing = false58 59minute_l := _q_int(_q_clock_prev_minute)60second_l := _q_int(_q_clock_prev_second)61day := _q_int(_q_clock_prev_day)62high_l := _q_high * 1.063low_l := _q_low * 1.064close_l := _q_close * 1.065trade_day := _q_int(day)66if minute_l >= session_minute67 trade_day := _q_int(_q_iadd(day, 1))68closing := _q_iadd(second_l, 1) >= exit_second and minute_l < session_minute69if _q_int(strategy.position_size) != 070 if closing or trade_day != traded_day71 if _q_int(strategy.position_size) > 072 _q_qty1 = _q_int(math.abs(_q_int(strategy.position_size)))73 if _q_qty1 <= 074 runtime.error("market order quantity must be a positive whole unit")75 _q_pos1 = _q_int(strategy.position_size)76 if _q_pos1 < 0 or _q_pos1 > 0 and _q_qty1 < _q_pos177 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")78 strategy.order("q1", strategy.short, _q_qty1)79 else80 _q_qty2 = _q_int(math.abs(_q_int(strategy.position_size)))81 if _q_qty2 <= 082 runtime.error("market order quantity must be a positive whole unit")83 _q_pos2 = _q_int(strategy.position_size)84 if _q_pos2 > 0 or _q_pos2 < 0 and _q_qty2 < -_q_pos285 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")86 strategy.order("q2", strategy.long, _q_qty2)87if trade_day != day_key88 if day_key != 089 if days > 0 and day_high < last_high and day_low > last_low90 armed_day := _q_int(trade_day)91 buy_level := day_high92 sell_level := day_low93 last_high := day_high94 last_low := day_low95 days := _q_int(_q_iadd(days, 1))96 day_key := _q_int(trade_day)97 day_high := high_l98 day_low := low_l99else100 day_high := math.max(day_high, high_l)101 day_low := math.min(day_low, low_l)102if _q_int(strategy.position_size) == 0 and armed_day == trade_day and traded_day != trade_day and not closing103 if close_l > buy_level104 _q_qty3 = _q_int(clip)105 if _q_qty3 <= 0106 runtime.error("market order quantity must be a positive whole unit")107 _q_pos3 = _q_int(strategy.position_size)108 if _q_pos3 > 0 or _q_pos3 < 0 and _q_qty3 < -_q_pos3109 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")110 strategy.order("q3", strategy.long, _q_qty3)111 traded_day := _q_int(trade_day)112 else if close_l < sell_level113 _q_qty4 = _q_int(clip)114 if _q_qty4 <= 0115 runtime.error("market order quantity must be a positive whole unit")116 _q_pos4 = _q_int(strategy.position_size)117 if _q_pos4 < 0 or _q_pos4 > 0 and _q_qty4 < _q_pos4118 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")119 strategy.order("q4", strategy.short, _q_qty4)120 traded_day := _q_int(trade_day) 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 daily 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 ESU6CL: 128 contracts, CLG6 to CLU6
- Costs paid
- ES: $1,083 in fees, $7,650 in slippageCL: $1,100 in fees, $5,450 in slippage
- Warm-up
- None: each contract reads only its own bars
- Flagged days
- ES: NoneCL: None Days the data holds too few bars for. Flagged, not removed.
Could you pass
a prop firm challenge
with the inside day 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 inside day breakout
What is the inside day breakout?
When a day trades inside the day before it, trade the next day's break above its high or below its low. Atlantive backtested it on CME futures from January 2016 to July 2026 after costs.
Is the inside day breakout profitable on ES futures?
Not in this backtest: on ES futures from January 2016 to July 2026 it lost $74,621 after costs, over 306 trades, positive in 2 of 11 years; on CL it made $16,700. Buying and holding one ES contract over the same window made $236,212. The average trade was −$244, its 95% interval −$462 to −$25. These are hypothetical results of a backtest, not of trading.
What are the inside day breakout's rules?
An inside day has a lower high and a higher low than the CME trading day before it (18:00 to 17:00 New York). The next trading day the first one-second close above the inside day's high buys and the first below its low sells short, once. The position is closed in that day's last minute, from 16:59 New York. Its parameters are the published ones, never tuned on the data it was tested on.
How was the inside day breakout backtested?
On CME Globex data from January 2016 to July 2026, one contract, on daily 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 inside day 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 inside day 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.