Discussing the article: "Automating Classic Market Methods in MQL5 (Part 7): The Nicolas Darvas Box System"

 

Check out the new article: Automating Classic Market Methods in MQL5 (Part 7): The Nicolas Darvas Box System.

This article implements the Darvas Box method as a complete MQL5 Expert Advisor. We code box detection with a three-session hold, volume contraction during consolidation, and volume-confirmed breakouts, plus a staircase pyramid with a shared, rolling stop at the latest box floor. The EA uses a state machine to run box scanning and trade management in parallel, providing a ready-to-compile system with configurable inputs and clear on-chart diagnostics.

Nicolas Darvas became one of the most celebrated traders of the twentieth century without any formal financial training. He was a dancer—performing across Europe and Asia in the 1950s while studying stock price behavior from weekly newspapers delivered to wherever his tour had taken him that week. He developed his method over several years of losses before discovering the pattern that made his fortune: stocks that formed tight, quiet boxes of price consolidation and then broke above them on expanding volume were about to make huge moves.

His rules were simple enough to apply with nothing more than a notebook and a pencil. A box top was the highest high, after which the price failed to make a new high for three consecutive sessions. A box bottom was the lowest low during the same period. When the price broke above the box top on volume expansion, he bought. The stop went below the box bottom. If the price advanced and formed a new box, he bought more. If the stop was hit, he exited without argument.

The method looks simple, but two aspects make it difficult to automate reliably. The first is the rolling box: each breakout from a box creates a new box immediately above it, and the EA must recognize when the new box has formed, store its boundaries, and retire the old one. The second is the staircase entry: Darvas did not buy once and hold. He pyramided—adding to his position each time the price broke into a new box. The pyramid grows as long as boxes keep forming above the entry. When a stop fires, the entire staircase unwinds.


Author: Tola Moses Hector