OPEN-SOURCE SCRIPT
Darvas Box Ladder [ITA]

🟠 OVERVIEW
Darvas Box Ladder plots the rectangle Nicolas Darvas traded, and then keeps plotting the ones that follow it. Darvas did not buy a box and sell it - he rode a ladder of them, staying in as each breakout built a new box higher and lifting his stop to the floor of the newest one. He got out when a box finally broke down.
The script builds each box the way Darvas built it, as a sequence of confirmations rather than a rectangle fitted after the fact, and keeps the completed rungs on the chart so the whole run stays visible.
🟠 CONCEPTS
A Darvas box has an order to it. The ceiling comes first: price makes a new high, and that high has to survive a set number of bars unbeaten before it counts. Only then does the floor form, from the lowest low printed since the ceiling, and it has to survive the same test.
That order matters. A rectangle drawn around any quiet stretch of price is just a consolidation range. A Darvas box is a leader pausing after a run to new highs, and the ceiling-then-floor sequence is what separates the two.
Because both levels come from confirmed structure, they are fixed once drawn and do not move afterwards.
🟠 FEATURES
🔹 The full ladder, not one box - completed rungs stay on the chart so you can see the whole advance rather than the current pause in isolation
🔹 Stop line under the active box - a dashed line at the floor, which is where Darvas kept his
🔹 Measured-move target - one box height projected above the ceiling
🔹 Volume-confirmed breakouts - a close above the ceiling only counts when volume beats its 20-bar average by your chosen multiple
🔹 Box under construction - a dashed ceiling shows while the box is still forming, so you can see one coming before it completes
🔹 New-high filter - boxes may only start from a high that is the highest of the lookback window, keeping the script on leaders instead of drawing rectangles inside downtrends
🔹 Height limits - boxes outside your minimum and maximum are discarded
🔹 Alerts on both the breakout and the box breaking down
🟠 HOW TO USE
Add it to a daily chart of a stock that has been making new highs - that is the setup Darvas was looking for, and the new-high filter will keep the script quiet on anything else.
Watch for the dashed ceiling. That is a box forming. When the floor confirms, the box turns solid and the stop line appears underneath it.
A green box with a triangle below the bar is a confirmed breakout on volume, and the next box begins from there. Each new rung is a chance to lift the stop to the newer, higher floor.
A red box marks the end of the run - price closed below the floor.
Confirmation Bars is the main setting. Darvas used 3. Higher values give fewer, cleaner boxes; lower values react faster and produce more of them.
🟠 CONCLUSION
The box is the easy part. The ladder is what Darvas actually traded, and it is what tells you whether a breakout is the start of a run or the end of one.
Darvas Box Ladder plots the rectangle Nicolas Darvas traded, and then keeps plotting the ones that follow it. Darvas did not buy a box and sell it - he rode a ladder of them, staying in as each breakout built a new box higher and lifting his stop to the floor of the newest one. He got out when a box finally broke down.
The script builds each box the way Darvas built it, as a sequence of confirmations rather than a rectangle fitted after the fact, and keeps the completed rungs on the chart so the whole run stays visible.
🟠 CONCEPTS
A Darvas box has an order to it. The ceiling comes first: price makes a new high, and that high has to survive a set number of bars unbeaten before it counts. Only then does the floor form, from the lowest low printed since the ceiling, and it has to survive the same test.
That order matters. A rectangle drawn around any quiet stretch of price is just a consolidation range. A Darvas box is a leader pausing after a run to new highs, and the ceiling-then-floor sequence is what separates the two.
Because both levels come from confirmed structure, they are fixed once drawn and do not move afterwards.
🟠 FEATURES
🔹 The full ladder, not one box - completed rungs stay on the chart so you can see the whole advance rather than the current pause in isolation
🔹 Stop line under the active box - a dashed line at the floor, which is where Darvas kept his
🔹 Measured-move target - one box height projected above the ceiling
🔹 Volume-confirmed breakouts - a close above the ceiling only counts when volume beats its 20-bar average by your chosen multiple
🔹 Box under construction - a dashed ceiling shows while the box is still forming, so you can see one coming before it completes
🔹 New-high filter - boxes may only start from a high that is the highest of the lookback window, keeping the script on leaders instead of drawing rectangles inside downtrends
🔹 Height limits - boxes outside your minimum and maximum are discarded
🔹 Alerts on both the breakout and the box breaking down
🟠 HOW TO USE
Add it to a daily chart of a stock that has been making new highs - that is the setup Darvas was looking for, and the new-high filter will keep the script quiet on anything else.
Watch for the dashed ceiling. That is a box forming. When the floor confirms, the box turns solid and the stop line appears underneath it.
A green box with a triangle below the bar is a confirmed breakout on volume, and the next box begins from there. Each new rung is a chance to lift the stop to the newer, higher floor.
A red box marks the end of the run - price closed below the floor.
Confirmation Bars is the main setting. Darvas used 3. Higher values give fewer, cleaner boxes; lower values react faster and produce more of them.
🟠 CONCLUSION
The box is the easy part. The ladder is what Darvas actually traded, and it is what tells you whether a breakout is the start of a run or the end of one.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Pine Script developer & trader. I build clean indicators - Smart Money Concepts, scanners, risk tools. ITAtradingtools.com
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Pine Script developer & trader. I build clean indicators - Smart Money Concepts, scanners, risk tools. ITAtradingtools.com
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.