16 / Ventures & FinanceStock Market
Darvas Box Strategy Backtest
Testing the 1950s Darvas box breakout strategy on every US stock since 1990 · September 2026
- 22,693US companies tested, including the 71% that later delisted
- 0.3 sFor one backtest across the whole market, 1990 to 2026
- 199 / 200Random-entry runs that beat the strategy’s own entries
- 1.67 → 0.28Sharpe ratio of the optimized system, fitted and then on the hold-out
Study objective
In the 1950s Nicolas Darvas turned a small account into about $2 million and described how in a best-selling book. His method has two halves: a judgement about which companies are worth owning, and a mechanical procedure for when to buy and sell them, built around price “boxes”.
The judgement cannot be tested, but the procedure can. I tested whether the mechanical half has an edge on its own, without the trader’s judgement, and whether optimizing every parameter, including the one number Darvas fixed, could produce a version that holds up on data not used to fit it.
It does not. The rules as written lost to randomly chosen stocks. Optimization produced a strong fitted result that mostly disappeared out of sample, and the remaining profit came from a different source: takeover targets. The main output of the project is the test itself, built so that a negative answer could be trusted.
Backtests only. Nothing on this page was traded, on paper or with real money.
Backtest engine and test design
- Data
Survivorship-free universe
Every US operating company from 1990 to 2026, including the 71% that later delisted, with a per-day flag for whether the stock was listed on a major exchange at the time.
- Engine
Sub-second backtest engine
Two numba kernels: one turns the box rules into a stream of events for every stock, the other steps a portfolio through the calendar. One full-universe run takes 0.3 to 0.5 seconds.
- Search
Bayesian optimization
Gaussian-process optimization over 20 parameters, including the three-day window Darvas treated as fixed, with walk-forward folds before the final fit.
- Controls
Falsification tests
Random-entry controls, one-at-a-time sweeps, plateau checks around the optimum, and a single hold-out period that the code refuses to run twice.
Darvas box rule set
I first wrote the method down as explicit rules, then implemented it as a four-state machine that reads one daily bar at a time for each stock. Buy orders rest above the box before the market opens, so every decision uses only the previous day’s close.
- Step 1
New high on heavy volume
A stock makes a new high while trading well above its normal volume. That day’s high becomes the provisional top of a box.
- Step 2
Three-day box confirmation
The top is confirmed when price fails to touch it for K = 3 days in a row, then the bottom the same way. Darvas fixed only this one number.
- Step 3
Breakout entry and trailing stop
A resting buy order sits just above the box. Once filled, a sell stop sits under the box floor and moves up under each new box. There is no profit target.

Universe data and backtest engine
Most breakout candidates are small companies, and most small companies from 1990 no longer exist. I built the universe from both the live and the delisted databases of a commercial data provider: every US operating company, excluding funds, trusts and blank-check shells, tradeable only on days it was listed on a major exchange.
The engine separates signals from portfolio. A numba kernel runs the box state machine across all 58 million bars and emits a sorted stream of events; a second kernel steps a $100,000 cash account through the calendar, competing signals for a limited number of positions. Signal results are cached by parameter, so sweeps that only change portfolio settings skip the expensive part.
That speed made the rest of the study possible: thousands of full-market backtests in under half an hour on one workstation.
Scale of the study
- Symbols in the two source databases
- 35,898
- Operating companies kept
- 22,693
- Share of those that later delisted
- 71.4%
- Daily bars cached
- 58.2 million
- Time to build the cache
- 211 seconds
- Optimizer trials run
- 2,200
- One-at-a-time sensitivity runs
- 104
- Random-entry control runs
- 1,000
Literal-rule backtest results
With Darvas’s own three-day window, $100,000 grew to $1.99 million by March 2000 and then lost 94% of it. Over 1990 to 2014 the strategy made 2.4% a year against 9.7% for the S&P 500. The reason is mechanical: a three-day box is so short that the stop sits inside ordinary daily noise. 97.8% of trades ended on a stop, after a median of 17 days.


- K = 0buy any new high−1.52
- K = 1−1.10
- K = 2−0.18
- K = 3Darvas’s rule+0.22
- K = 7+0.47
- K = 8+0.40
- K = 10+0.55
Sweeping one parameter at a time located the weakness. Most parameters gave noisy, directionless responses, which is consistent with a weak signal. The confirmation window was the exception: longer is better, up to the top of the range. The one number Darvas fixed was the most important parameter, and three days is the wrong value for modern US stocks.
A market filter, trading only when the S&P 500 is above its 200-day average, more than doubled the Sharpe ratio (0.22 to 0.53) and halved the drawdown. That helped more than any change to the box itself.
Optimization and hold-out results
I then ran a Gaussian-process optimizer over 20 parameters on 1990 to 2014, with a floor on trade count so that it could not score well by rarely trading. The fitted system was more selective: an eight-day window, boxes no taller than 10%, volume four times normal, small positions. On the fitted window that made 8.5% a year with a 5.6% worst drawdown and a Sharpe ratio of 1.67.
I then ran it once on 2015 to 2026, a period not used to fit any parameter. The Sharpe ratio there was 0.28.
- 1990 – 2014 (fitted)
- 2015 – 2026 (hold-out, run once)
- Literal Darvas rules0.22−0.35
- Optimized parameters1.670.28
- Optimized, liquid stocks, 2.5× slippage0.860.17
- S&P 500 total return0.600.82

| Run | Window | Return per year | Sharpe | Worst drawdown | Trades |
|---|---|---|---|---|---|
| Literal rules | 1990 – 2014 | 2.4% | 0.22 | −93.9% | 2,782 |
| Literal rules | Hold-out | −12.4% | −0.35 | −86.3% | 1,449 |
| Optimized (fitted on this window) | 1990 – 2014 | 8.5% | 1.67 | −5.6% | 552 |
| Optimized | Hold-out | 1.2% | 0.28 | −16.0% | 401 |
| Optimized, liquid stocks only, 2.5× slippage | Hold-out | 0.7% | 0.17 | −21.6% | 365 |
| S&P 500 total return | 1990 – 2014 | 9.7% | 0.60 | −55.3% | – |
| S&P 500 total return | Hold-out | 13.8% | 0.82 | −33.8% | – |
Overfitting indicators before the hold-out
- Bounds
Best set on nine search limits
An optimum on the edge of its allowed search range indicates a direction, not a final value.
- Spikes
One-integer peak at K = 8
The Sharpe ratio was 1.24 at K = 7, 1.67 at K = 8 and 1.48 at K = 9. A real effect does not depend on one integer.
- Costs
Drift into illiquid stocks
With flat 0.1% slippage, the optimizer pushed the liquidity floor to its minimum. Realistic floors and 2.5× slippage cut the fitted Sharpe from 1.67 to 0.86.
- Walk-forward
Optimistic walk-forward estimate
Stitched out-of-sample folds inside 1990 – 2014 gave a Sharpe of 0.88. The true hold-out gave 0.28. Folds inside one window shared too much with the final fit.

Hold-out profit attribution
A later review of the trade files, which my first report had missed, split the profit by how each position ended. In the hold-out, the 304 ordinary closed trades lost money. The entire net profit came from 85 positions held until the stock delisted and 12 still open on the final day.
The delisted positions do not look like breakouts. While held, their median annualized volatility was 3.3%, against 22% for the other trades, and 65% were winners with a median gain of 0.4%.
That is the profile of an announced acquisition. A takeover bid makes a stock jump to a multi-year high on several times its normal volume, which passes the volume and new-high tests. It then trades in a range of a few percent until the deal closes, which passes the tight-box test, and it leaves the market at the deal price. The optimizer had tuned a breakout system into a takeover detector, and those are merger-arbitrage returns, not evidence for the box method.
- 85 positions held into a delisting+$9,625
- 12 positions still open on the last day+$14,808
- The other 304 trades−$9,655
- Net profit+$14,779
Conclusion. Darvas’s mechanical procedure is not an edge on its own in this data. The one property that survived is risk containment: the optimized system’s worst hold-out drawdown was 16% against 34% for the S&P 500, at about 40% exposure, for roughly one-twelfth of the index’s return. His results came from what this test removed: his stock selection, heavy concentration on margin, and a strong bull market.
Verification and controls
- Universe
Delisted companies included
68% of the literal strategy’s trades were in stocks that later delisted. A database of survivors only would have produced a different and invalid study.
- Verification
Two independent implementations
A separate plain-pandas version of the rules agreed with the fast kernel event for event on 40 real symbols. 28 tests pass.
- Look-ahead
Future-data leak tests
Tests cut off or scramble all later data and confirm that no earlier signal changes. Orders are resting before the open and use only the prior close.
- Hold-out
Single locked evaluation
The 2015 – 2026 period was run once. The list of candidates, including a pessimistic cost variant, was fixed in code beforehand, and a lock file records that it was not re-run.
- Costs
Transaction costs in every figure
$0.005 a share commission and 0.10% slippage per side, cash only, no leverage. Gaps through a stop fill at the open, not at the stop.
- Limits
Known limitations
Daily bars cannot show whether a day’s low came before its high, so a same-day stop rule is pessimistic for the literal rules and makes the random-entry comparison less clean. Sharpe ratios use a zero risk-free rate.
Six-stage study pipeline
- 01
Build a survivorship-free, point-in-time price cache for the whole US market.
- 02
Run Darvas’s rules exactly as written, against two index benchmarks.
- 03
Sweep each parameter one at a time and compare the entries with random stock picks.
- 04
Walk-forward optimization: four folds of 300 trials inside 1990 – 2014.
- 05
Two final 500-trial optimizations on 1990 – 2014, with plateau checks around the best set.
- 06
One locked evaluation on 2015 – 2026, then attribution of where the profit came from.
Every figure is a backtest on daily data from 1990 to September 2026. Past performance does not predict future results. Nothing here is investment advice.