Double 7s strategy
On ES futures from January 2016 to July 2026, the Double 7s strategy made $63,832 after costs and made money in 7 of 11 years.
Mean reversionSwingDaily barsBacktested Nov 6, 2026
Double 7s backtest, the result
Contract
E-mini S&P 500
-
+$63.8K
Net after costs
After $2,880 in fees and slippage
-
7 of 11
Years that made money
January 2016 to July 2026
-
−$55.2K
Largest drawdown
Peak to trough, 1 contract
-
$595
Average trade
106 trades
Net after costs by month, January 2016 to July 2026.
Double 7s rules
In an uptrend, buy a close at the lowest of the last 7 days, and sell a close at the highest of the last 7.
A drawing of the rules on a made-up day, not a result.
- When a CME trading day closes above its 200-day simple average and at the lowest close of the last seven days, the strategy buys one contract.
- It sells when a day closes at the highest close of the last seven days.
- Long only, with no stop.
- From
- Larry Connors and Cesar Alvarez, Short Term Trading Strategies That Work
- Decides on
- Daily bars
- Holds
- Overnight and across days
- Parameters
- trend 200
Results by year
It made money in 7 of 11 years on ES. Its best year was 2021, +$43,085, and its worst 2020, −$39,606.
| Year | Net | Trades | Win rate | Drawdown | Buy and hold |
|---|---|---|---|---|---|
| 2016 | +$163 | 3 | 100% | −$2,825 | +$11,497 |
| 2017 | +$12,295 | 13 | 100% | −$2,900 | +$21,936 |
| 2018 | −$10,937 | 11 | 64% | −$18,643 | −$8,589 |
| 2019 | +$9,557 | 9 | 67% | −$11,887 | +$35,436 |
| 2020 | −$39,606 | 9 | 67% | −$54,021 | +$27,761 |
| 2021 | +$43,085 | 15 | 80% | −$12,941 | +$51,361 |
| 2022 | −$12,945 | 2 | 0% | −$26,300 | −$45,939 |
| 2023 | −$4,612 | 10 | 50% | −$25,286 | +$38,435 |
| 2024 | +$22,808 | 14 | 79% | −$25,487 | +$42,947 |
| 2025 | +$13,669 | 12 | 75% | −$27,670 | +$37,010 |
| 2026, Jan to Jul | +$30,355 | 8 | 75% | −$16,191 | +$24,355 |
Double 7s backtest results
On ES it made $66,713 before costs. Fees and slippage took $2,880 of that.
- Net = before costs − fees − slippage
- ES: $66,713 − $380 − $2,500 = $63,832
The interval holds zero: this test cannot tell the average trade from no edge.
Double 7s 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, SELL, Bars, Rolling, RollingMinMax, Strategy2 3 4class DoubleSevens(Strategy):5 """Connors' Double 7s: buy a seven-day closing low in an uptrend, sell a seven-day closing high.6 7 A day is the CME trading day, 18:00 to 17:00 New York (the run's daily bars). When a day closes8 above its 200-day simple mean and at the lowest close of the last seven days, the strategy buys9 one contract. It sells when a day closes at the highest close of the last seven days. Long only.10 Each decision is taken at a daily close and fills at the next session's first one-second bar, at11 the 18:00 New York reopen.12 """13 14 data = "bars"15 16 class Params:17 trend: int = 20018 clip: int = 119 20 class State:21 bars: Bars(interval_ns=86_400_000_000_000)22 long: Rolling(window=200)23 closes: RollingMinMax(window=7)24 25 def on_event(self, view, ev, orders):26 if not self.bars.update(ev):27 return28 close = float(self.bars.prev_close)29 self.long.update(close)30 self.closes.update(close)31 if self.long.count < self.p.trend:32 return33 if view.position > 0:34 if close >= self.closes.max():35 orders.ioc(side=SELL, qty=abs(view.position))36 elif view.position == 0 and close > self.long.mean() and close <= self.closes.min():37 orders.ioc(side=BUY, qty=self.p.clip) 1//@version=62// DoubleSevens, 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("DoubleSevens", 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() != 8640011 runtime.error("DoubleSevens was exported for the 1 day timeframe; set the chart to 1D.")12 13trend = input.int(200, "trend", minval=-9007199254740991, maxval=9007199254740991)14clip = input.int(1, "clip", minval=-9007199254740991, maxval=9007199254740991)15 16_q_safe_int(x) =>17 if math.abs(x) > 900719925474099118 runtime.error("an integer left the exact chart range; this run cannot be compared faithfully")19 int(x)20_q_int(x) => _q_safe_int(x < 0 ? math.ceil(x) : math.floor(x))21 22_q_close = _q_int(math.round(close * 1000000000.0))23 24var _q_long_buf = array.new_float(200, 0.0)25var int _q_long_idx = 026var int _q_long_count = 027var float _q_long_off = 0.028var float _q_long_sum = 0.029var float _q_long_sumsq = 0.030var int _q_long_skipped = 031var _q_closes_buf = array.new_float(7, 0.0)32var int _q_closes_idx = 033var int _q_closes_count = 034var int _q_closes_skipped = 035var _q_closes_hiq = array.new_int(7, 0)36var int _q_closes_hih = 037var int _q_closes_hin = 038var _q_closes_loq = array.new_int(7, 0)39var int _q_closes_loh = 040var int _q_closes_lon = 041float close_l = na42 43bool _q_running = true44close_l := _q_close * 1.045_q_sample1 = close_l46if na(_q_sample1) or math.abs(_q_sample1) > 1.7976931348623157e30847 _q_long_skipped := _q_long_skipped + 148else49 if _q_long_count == 050 _q_long_off := _q_sample151 if _q_long_count >= 20052 _q_old2 = array.get(_q_long_buf, _q_long_idx) - _q_long_off53 _q_long_sum := _q_long_sum - _q_old254 _q_long_sumsq := _q_long_sumsq - _q_old2 * _q_old255 else56 _q_long_count := _q_long_count + 157 _q_dev2 = _q_sample1 - _q_long_off58 array.set(_q_long_buf, _q_long_idx, _q_sample1)59 _q_long_sum := _q_long_sum + _q_dev260 _q_long_sumsq := _q_long_sumsq + _q_dev2 * _q_dev261 _q_long_idx := (_q_long_idx + 1) % 20062 if _q_long_idx == 0 and _q_long_count >= 20063 _q_origin2 = _q_long_off + _q_long_sum / _q_long_count64 _q_total2 = 0.065 _q_totalsq2 = 0.066 for _q_j2 = 0 to 19967 _q_e2 = array.get(_q_long_buf, _q_j2) - _q_origin268 _q_total2 := _q_total2 + _q_e269 _q_totalsq2 := _q_totalsq2 + _q_e2 * _q_e270 _q_long_off := _q_origin271 _q_long_sum := _q_total272 _q_long_sumsq := _q_totalsq273_q_sample3 = close_l74if na(_q_sample3) or math.abs(_q_sample3) > 1.7976931348623157e30875 _q_closes_skipped := _q_closes_skipped + 176else77 if _q_closes_count >= 7 and _q_closes_hin > 0 and array.get(_q_closes_hiq, _q_closes_hih) == _q_closes_idx78 _q_closes_hih := (_q_closes_hih + 1) % 779 _q_closes_hin := _q_closes_hin - 180 if _q_closes_count >= 7 and _q_closes_lon > 0 and array.get(_q_closes_loq, _q_closes_loh) == _q_closes_idx81 _q_closes_loh := (_q_closes_loh + 1) % 782 _q_closes_lon := _q_closes_lon - 183 array.set(_q_closes_buf, _q_closes_idx, _q_sample3)84 while _q_closes_hin > 085 _q_back3_hi = array.get(_q_closes_hiq, (_q_closes_hih + _q_closes_hin - 1) % 7)86 if array.get(_q_closes_buf, _q_back3_hi) <= _q_sample387 _q_closes_hin := _q_closes_hin - 188 else89 break90 array.set(_q_closes_hiq, (_q_closes_hih + _q_closes_hin) % 7, _q_closes_idx)91 _q_closes_hin := _q_closes_hin + 192 while _q_closes_lon > 093 _q_back3_lo = array.get(_q_closes_loq, (_q_closes_loh + _q_closes_lon - 1) % 7)94 if array.get(_q_closes_buf, _q_back3_lo) >= _q_sample395 _q_closes_lon := _q_closes_lon - 196 else97 break98 array.set(_q_closes_loq, (_q_closes_loh + _q_closes_lon) % 7, _q_closes_idx)99 _q_closes_lon := _q_closes_lon + 1100 _q_closes_idx := (_q_closes_idx + 1) % 7101 _q_closes_count := math.min(_q_closes_count + 1, 7)102if _q_long_count < trend103 _q_running := false104if _q_running105 if _q_int(strategy.position_size) > 0106 if close_l >= (_q_closes_count == 0 ? 0.0 : array.get(_q_closes_buf, array.get(_q_closes_hiq, _q_closes_hih)))107 _q_qty4 = _q_int(math.abs(_q_int(strategy.position_size)))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("q1", strategy.short, _q_qty4)114 else if _q_int(strategy.position_size) == 0 and close_l > (_q_long_count == 0 ? 0.0 : _q_long_off + _q_long_sum / _q_long_count) and close_l <= (_q_closes_count == 0 ? 0.0 : array.get(_q_closes_buf, array.get(_q_closes_loq, _q_closes_loh)))115 _q_qty5 = _q_int(clip)116 if _q_qty5 <= 0117 runtime.error("market order quantity must be a positive whole unit")118 _q_pos5 = _q_int(strategy.position_size)119 if _q_pos5 > 0 or _q_pos5 < 0 and _q_qty5 < -_q_pos5120 runtime.error("this order would add to or partially reduce a position, so its trade ledger would not be faithful")121 strategy.order("q2", strategy.long, _q_qty5) 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 ESU6NQ: 43 contracts, NQH6 to NQU6
- Costs paid
- ES: $380 in fees, $2,500 in slippageNQ: $388 in fees, $3,120 in slippage
- Warm-up
- Each new contract first reads the last 200 trading days, moved onto its prices
- 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 Double 7s strategy?
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 Double 7s strategy
What is the Double 7s strategy?
In an uptrend, buy a close at the lowest of the last 7 days, and sell a close at the highest of the last 7. The rules follow Larry Connors and Cesar Alvarez, Short Term Trading Strategies That Work. Atlantive backtested it on CME futures from January 2016 to July 2026 after costs.
Is the Double 7s strategy profitable on ES futures?
In this backtest it made money: on ES futures from January 2016 to July 2026 it made $63,832 after costs, over 106 trades, positive in 7 of 11 years; on NQ it made $219,337. Buying and holding one ES contract over the same window made $236,212. The average trade was $595, its 95% interval −$659 to $1,665. These are hypothetical results of a backtest, not of trading.
What are the Double 7s strategy's rules?
When a CME trading day closes above its 200-day simple average and at the lowest close of the last seven days, the strategy buys one contract. It sells when a day closes at the highest close of the last seven days. Long only, with no stop. The rules follow Larry Connors and Cesar Alvarez, Short Term Trading Strategies That Work. Its parameters are the published ones, never tuned on the data it was tested on.
How was the Double 7s strategy 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 Double 7s strategy 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 Double 7s strategy 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.