Darvas Box Staircase — Three-Session Hold, Volume Breakout, Pyramid
Nicolas Darvas: quiet consolidation boxes, break out on expanding volume, pyramid into higher boxes, share one stop at the latest floor. This page locks the public MQL5 rule chain. It is not a Quant for Free clean-room backtest.
Most retail “Darvas Box” scripts stop at a rectangle and a breakout arrow. The hard part — the part this MQL5 essay actually automates — is the rolling box and the staircase: after you are in, the engine keeps scanning for the next confirmed box above (or below) you, adds a unit on the next volume-confirmed break, and lifts every open unit’s stop to the new floor. When the shared floor breaks, the whole staircase exits together.
Quant for Free already covers loud opens and session imbalance elsewhere: Stocks-in-Play RelVol ORB and Session VWAP Bias. Darvas is a different object — classic multi-day box + pyramid — so this teardown stays on rule clarity and what a honest validation run would still need. We do not have a site summary.json for this slug. Sharpe, Deflated Sharpe, trade counts, and equity curves below are either labeled source claims from the article or omitted as untested.
Credit. Public implementation essay: Tola Moses Hector, Automating Classic Market Methods in MQL5 (Part 7): The Nicolas Darvas Box System (MQL5 article 24111, 18 September 2026). Historical book cited by the author: Darvas, How I Made $2,000,000 in the Stock Market (1960). No Expert Advisor source was copied into a Q4F pipeline; this page paraphrases the published rule set only.
1 / What the object is
One sentence the article itself asks the EA to answer: did price form a valid low-volume box and break out on expanding volume — and if so, does it keep forming higher boxes for add-ons, or has the shared stop been hit?
- Bull box: new high holds for three sessions → box top / bottom confirmed → close above top with volume expansion → long.
- Bear box: mirror for shorts (new low holds three sessions; breakout below bottom on volume).
- Staircase: each subsequent box breakout can add a unit (subject to a unit cap); all units share the stop at the latest box floor (bull) or ceiling (bear).
- Exit: close of a completed bar through the shared stop closes all units. Optional stall exit if no new box forms within a bar budget after the last breakout.
The article’s automation insight is state coexistence: while a trade is open, the box engine does not idle. Detection of the next extreme / confirmation / breakout runs in parallel with stop and stall checks. Without that parallel watch, the staircase cannot form.
2 / How the rules chain
The essay lists five validity conditions before a breakout can open the first unit (and again for later adds):
- N-bar extreme. Bull: last completed bar’s high is a new high over
InpLookbackBars(lookback comparison starts at bar 2 so the extreme bar is not compared to itself). Bear: new N-bar low. - Three-session hold. After the extreme is set,
InpConfirmSessionsconsecutive sessions must fail to exceed the box top (bull) or undercut the box bottom (bear). A new extreme during confirmation resets the top/bottom and restarts the counter. - Quiet box-volume gate. Average volume over the box formation period must stay below
InpBoxVolMult× a longer-term average volume (quiet consolidation; default multiplier1.0means “below average”). - Minimum box height. Top − bottom must exceed
InpMinBoxATR× ATR (default0.5× ATR14). - Breakout volume expansion. Breakout bar volume must exceed box-period average volume by
InpBreakVolMult(default1.3— at least 30% above the box average). Bull entry requires close above box top; bear requires close below box bottom. Entry is on the completed breakout bar’s close.
Default inputs the article publishes
| Input | Default (source) | Role |
|---|---|---|
InpLookbackBars | 50 | N-bar extreme window |
InpConfirmSessions | 3 | Darvas three-session hold |
InpMinBoxATR | 0.5 | Min height in ATR units |
InpBoxVolMult | 1.0 | Max box vol vs longer average (quiet) |
InpBreakVolMult | 1.3 | Min breakout vol vs box average |
InpMaxUnits | 4 | Staircase unit cap |
InpMaxBarsBetweenBoxes | 20 | Stall exit if no new box |
InpStopBuffer | 0.3 | ATR buffer beyond box floor/ceiling |
InpRiskPercent | 1.0 | Risk per unit (% of balance) |
InpATRPeriod | 14 | ATR length |
Source claim (author — not a Q4F run). On EURUSD D1 the article expects roughly 10–20 initial breakout signals per year, with perhaps 5–10 of those developing into multi-unit staircases. It recommends daily timeframe testing on EURUSD / GBPUSD and notes tick volume as a forex proxy that may need broker-specific calibration. Treat those as essay expectations, not Quant for Free measurements.
Staircase and shared stop
- First breakout opens unit 1; stop at box bottom (bull) or top (bear), with the ATR buffer.
- While in trade, the engine watches for the next extreme → three-session confirm → volume breakout.
- Each add opens another unit (until
InpMaxUnits) and advances the shared stop to the new box floor/ceiling — never retreats. - Close below (long) / above (short) the shared stop on the last completed bar closes every unit. Stall: if bars since last breakout exceed
InpMaxBarsBetweenBoxes, close all (“trend stalled” in this EA’s interpretation).
The article contrasts that stall timer with Darvas’s own practice (hold through trends without new boxes as long as the last floor holds) and flags the hard close as a known limitation / future extension candidate (e.g. trail instead of flat exit).
3 / What this is not (and why that matters)
This is a method teardown. Sibling analysis pages that ship equity curves and Deflated Sharpe do so because a clean-room pipeline emitted a summary.json. This slug has none. We therefore do not invent:
- in-sample / out-of-sample Sharpe,
- Deflated Sharpe Ratio or trial count,
- Q4F trade counts, win rates, or equity curves,
- “survives = true/false” from a site gauntlet we did not run.
The MQL5 piece is an automation tutorial with journal diagnostics and chart boxes — not a peer-reviewed OOS study under Quant for Free site costs. Copying its qualitative “what to expect” language into our verdict line as if it were a validated edge would be the content-mill move. We are not going to.
4 / Where it sits next to RelVol ORB and Session VWAP
RelVol ORB asks whether abnormal opening-range volume plus first-bar bias is a standalone day-trade system. Session VWAP Bias asks about session VWAP imbalance. Darvas asks a slower question: multi-session quiet box → volume breakout → pyramid with a rising floor.
Volume still matters — but as a box quiet / breakout loud pair on daily (or other completed) bars, not as a 5-minute RelVol scanner. If you already treat RelVol-at-open and session VWAP as covered, Darvas is the classic box+staircase cousin, not a duplicate of those edges.
5 / What would need validation next
A shippable validated edge is rare. If this rule set ever becomes a Q4F analysis with numbers, the next attempts — all currently untested here — would need at least:
- Clean-room lock. Reproduce the five gates + staircase state machine in Python (or equivalent) without pasting MQL; document fill clock (close of completed bar), tick vs real volume, and long/short modes.
- Costs. Site-style friction (spread/slip/commission) before any gross equity narrative. Forex tick-volume multipliers may need sensitivity sweeps per feed.
- OOS structure. Chronological hold-out or walk-forward; do not tune
InpBreakVolMult/ lookback on the same window you report. - Multiple testing / DSR. If Optuna or a grid touches confirm sessions, ATR floor, breakout mult, max units, or stall bars, deflate the peak Sharpe against trial count — same gauntlet as other teardowns.
- Stall vs trail. Compare the article’s hard stall exit to a “hold while floor holds” variant closer to the book narrative — labeled as a separate hypothesis, not a silent fix.
- Universe honesty. Essay recommendations (EURUSD / GBPUSD D1) vs equity daily boxes Darvas originally traded are different experiments; do not pool them under one Sharpe.
None of those lines have Quant for Free numbers attached, because this pipeline did not produce them.
6 / Verdict
Clear classic box+staircase object. Not yet a Q4F-validated edge — and that is not a dead end.
The public MQL5 Part 7 rule chain is concrete: N-bar extreme → three-session confirmation → quiet box volume → minimum ATR height → volume-expanded breakout close → shared stop at the latest box floor → staircase adds up to four units with a non-retreating stop → optional stall close. That is enough to build a clean-room from, and not enough to ship.
We leave the possibility open: run the gauntlet (costs, OOS, DSR) on a locked translation of these rules; keep RelVol ORB / Session VWAP as the volume-at-open / session-bias cousins rather than forcing Darvas into their frames. Until a summary.json exists, the honest status is rules locked, edge untested on this site.
Check related claims the same way
Related · TeardownStocks-in-Play RelVol ORB — volume at the open, not multi-day boxes Related · Teardown
Session VWAP Bias — session imbalance line Related · Teardown
NY 15-minute ORB — time-window breakout cousin Learn · Deep dive
Deflated Sharpe Ratio — what a future Darvas grid would still need Learn · Module
Validation gauntlet — overfitting, OOS, DSR, costs Tool
OOS Lab — hold-out structure before trusting any box EA journal