TradingView
JohnMuchow
11 Th06 2021 17:37

Darvas Box Theory - Tracking Uptrends 

Deere & CompanyNYSE

Mô tả

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.






Phát hành các Ghi chú

Version 2.0

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

Phát hành các Ghi chú

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.

Phát hành các Ghi chú

Version 4.0

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

Phát hành các Ghi chú

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.

Phát hành các Ghi chú

Version 6.0

■ Minor updates to visual layout of boxes.

Phát hành các Ghi chú

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.





Phát hành các Ghi chú

Version 8.0

■ Updates to Settings and managing border colors and transparency.
Bình luận
dvrkxx
Are there any options to get the source code or buy it?
JohnMuchow
Thanks for your interest in the script. Although this project is not open source, I'm open to ideas and suggestions for future updates.
derlanlima
@JohnMuchow, I would be interested in purchasing the source code if available
JohnMuchow
Thanks for your interest, however, the code isn't available to purchase.
lertsak
Thank you for Great Work ! John. I have questions and suggest as follows

1) How does look back work ?
1.1 ) the number in each option will be used once the current time is change to that ?
1.2 ) What does it mean for setting a "day as 3" for example. I play with it but I could not see how does it change so I am confusing on how does it work on optimizing time period.

2) Add on an option of how far that price go from High to Low as a A) percentage would be and B) time (bar / days) would be great !
Appreciated !
lertsak
From my observation, the higher number of look back, the stronger uptrend of the new box created ?

Do I understand correctly ?
JohnMuchow
I think it depends on your trading style and timeframe. For shorter term traders, more frequent boxes may help provide some insight into potential trading opportunities. I typically leave all my lookback values at 1 so I can see each new box start and then look for other potential signs of price and volume action.
pkopensrc
Great code. I coded same but was getting boxes inside boxes.
Love to see the code to learn and implement.
Please open source it for developers
Thêm nữa