Darvas Box Theory — Tracking Uptrends

JohnMuchow Updated   
The Darvas box theory is based on the work of Nicolas Darvas, author of the book "How I Made $2 Million in the Stock Market". This indicator uses his box theory to help visualize upward trends and find potential opportunities to buy or add to a position.

Darvas was a growth stock trader. After extensive study of historical stock movements, Darvas noted stocks "have a defined upward or downward trend which, once established, tended to continue. Within this trend stocks moved in a series of frames, or what I began to call boxes."

Darvas Box Theory
■ A box defines a high and low range that contains a stock's movement over a period of time.
■ Darvas preferred "lively" stocks that moved up and down within a box. In his research, Darvas noted stocks with these characteristics often had significant moves up.
■ Boxes stacked one after another often indicate a strong upward trend.
■ A potential buy signal is a stock moving past the high of the topmost box with a significant increase in volume.
■ Within the range of a box, Darvas considered movement to the bottom of the range a healthy sign. These moves down shakeout weak holders who sell thinking the downward trend may continue.

Defining a Box:
■ After price makes a new high, there must be three consecutive bars that don't exceed the high.
■ Once the top of the box is set, the same process is used, in reverse, to determine the bottom.
■ Once the high and low are established, a box is drawn over the range of bars.
■ With this indicator, there are two options to determine when a box is complete, that is, when a box is fully enclosed and a new box can be started. The default is when there is a close above or below the high or low of the box. Using the close may provide a better perspective of the overall trend by limiting noise of price movements within a bar. The second option to complete a box is when a bar's high or low goes above or below the boundaries of the box. The preferred option is configurable within the indicator Settings.

Lookback Range
■ The lookback range is used to determine if the current bar has reached a new high, which could indicate the start of a new box.
■ The value specified for the lookback determines how many bars back to compare against the current bar high.
■ You can set the lookback value for intraday, daily and weekly charts.
■ It's recommended to experiment with lookback values across various timeframes to find settings that fit with your trading style.

Suggestions from Darvas:
■ The box theory works best during a strong uptrend, where boxes stack one after another.
■ When breaking through the top of the box, ideally there will be a significant increase in volume. This may be an opportunity to buy or add to a position.
■ Try and hold stocks that are consistently moving up by raising a stop-loss along with the rise.
■ Take losses quickly.

Indicator Features:
■ Box completion can be based on a close above/below the box boundaries or a move above/below the box boundaries.
■ Configure the lookback range for intraday, daily and weekly charts.
■ Configure box borders and background colors.
■ When the last bar is within a box, show an optional breakout price indicating a move above the top of box.

Release Notes:
Version 2.0

What's New:
■ Option to show distance to breakout price (box highest high) as a percentage.
Release Notes:
Version 3.0

What's New:
■ Custom alerts on break above box high or below box low.
■ Option to show distance in price and percentage to box high and/or low.
Release Notes:
Version 4.0

What's New:
■ Allow price/percentage labels to be adjusted left/right in relation to the last bar.
Release Notes:
Version 5.0

■ Option to show the rightmost vertical bar, one bar to right to candle wicks are not obscured.
■ Borders can be turned off/on.
Release Notes:
Version 6.0

■ Minor updates to visual layout of boxes.
Release Notes:
Version 7.0

■ Added two options for determining box highs and lows.
■ Box border styles are now configurable.
■ Choose timeframes (intraday, daily, etc) to display boxes.

Release Notes:
Version 8.0

■ Updates to Settings and managing border colors and transparency.

Your support is greatly appreciated! Cheers! 🍻

$30 worth of TradingView Coins for you & a friend:
Paypal Donation:
Power Trend Pro:
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?