OPEN-SOURCE SCRIPT
[Kpt-Ahab] Planned Order Visualizer IND

This Script visualizes planned long or short positions, including an optional existing position size, average entry price, up to three planned entries, a stop-loss level, and an estimated liquidation price. The current position can be treated either as already open or as a new planned entry. In simulation mode, all active entries are included in the calculation immediately, while in live mode only triggered price levels are included. Additional safety settings help prevent historical alerts and can optionally block entry or SL levels that would trigger immediately. The script is designed for planning, visualization, and alerting of planned positions.

**Tips**
* Use **Simulation** mode to preview how all active entries affect the average price before any live alerts are enabled.
* Use **Live** mode only when you want the script to track price-level triggers in real time.
* Keep **Trigger only in realtime** enabled when using alerts, to avoid historical alert triggers after loading the script.
* Use **Block marketable entry limits** and **Block marketable SL** to prevent levels that would trigger immediately.
* Increase the **Reset counter** only when you intentionally want to reset all triggered states and prepare a fresh setup.
* The liquidation price is an estimate for planning purposes and may differ from the exact exchange liquidation price.
This script currently uses a fixed entry structure with `E0` plus `E1`, `E2`, and `E3`. To increase the number of planned entries, duplicate the existing entry blocks and keep the same naming pattern.
For every additional entry, add:
* new input fields for active state, price, and quantity
* new submitted and triggered flags
* average price quantity/value calculations
* price-allowed and price-hit logic
* alert trigger logic
* line and label objects
* table rows if the entry should be shown in the info table
**Tips**
* Use **Simulation** mode to preview how all active entries affect the average price before any live alerts are enabled.
* Use **Live** mode only when you want the script to track price-level triggers in real time.
* Keep **Trigger only in realtime** enabled when using alerts, to avoid historical alert triggers after loading the script.
* Use **Block marketable entry limits** and **Block marketable SL** to prevent levels that would trigger immediately.
* Increase the **Reset counter** only when you intentionally want to reset all triggered states and prepare a fresh setup.
* The liquidation price is an estimate for planning purposes and may differ from the exact exchange liquidation price.
This script currently uses a fixed entry structure with `E0` plus `E1`, `E2`, and `E3`. To increase the number of planned entries, duplicate the existing entry blocks and keep the same naming pattern.
For every additional entry, add:
* new input fields for active state, price, and quantity
* new submitted and triggered flags
* average price quantity/value calculations
* price-allowed and price-hit logic
* alert trigger logic
* line and label objects
* table rows if the entry should be shown in the info table
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.