Concept
Rectangle
Rectangle, also known as box, Darvas box, is a Chart & Candlestick Patterns concept. The Library holds 3 implementations, each one a working definition you can pull into Quant.
Top Rectangle indicators
3 total
What is a Rectangle?
A rectangle is a consolidation bounded by two roughly horizontal, parallel lines: price oscillates between a flat ceiling and a flat floor, with classical convention asking for at least two touches of each boundary before the pattern earns the name. It is the chart-pattern formalization of a trading range, and the box variants popularized by Nicolas Darvas in the 1950s treat each completed rectangle as a building block in a trending stock.
Rectangles resolve by breakout. Classical texts file them under continuation patterns because the break tends to go with the prior trend, but the boundaries carry no directional obligation and either side can give way. The standard measure rule projects the box's height from the breakout level to set a minimum objective.
How traders use it
- Breakout trading: enter on a close beyond a boundary, target the box height projected from the break, and invalidate on a return inside the range; a failed break that falls back into the box is a standard cue to stand down or reverse.
- Range trading inside wide rectangles: fading the floor and ceiling while the box holds, with the known failure mode that the rotation which ends in a breakout stops out whoever faded it.
- Darvas-style trend following: in an uptrend, each new box forming above the previous one is read as continuation; entries go on the break of the box top with a stop under the box low, ratcheting upward as new boxes stack.
Rectangle vs. neighboring patterns
Trading Range: Trading range names the market condition of two-sided rotation; rectangle is the drawn pattern, with touch conventions, boundary lines, and a measure-rule target attached.
Bull/bear Flag: Flags are brief pauses that slope against the preceding impulse; rectangles are horizontal, typically last longer, and need not sit on a flagpole.
Ascending/descending/symmetrical Triangle: Triangles have at least one converging boundary, so the range narrows toward an apex; a rectangle's boundaries stay parallel and the range width holds.
Related concepts · Continuation chart patterns
Concept family
Chart & Candlestick Patterns
84 concepts mapped · 46 in the Library
Rectangle FAQ
Is a rectangle pattern bullish or bearish?
Neither by construction. Classical literature treats rectangles as continuation patterns, meaning the break is expected in the direction of the prior trend, but that is a tendency rather than a rule. Both boundaries are live until one breaks, which is why most traders trade the resolution instead of predicting it.
What is a Darvas box?
Nicolas Darvas's 1950s method drew a box around each consolidation in a rising stock: a ceiling confirmed by failed attempts to exceed it and a floor confirmed by holding lows. He bought when price broke above the current box, trailed a stop beneath it, and added as new boxes formed higher. The Darvas box is a trend-following application of the rectangle's horizontal-boundary logic.
Build Rectangle your way.
Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.


