PROTECTED SOURCE SCRIPT
Trade Box Position Calculator (Pro-V2)

Trade Box Position Calculator (Pro) is a visual risk management and position sizing tool that overlays a clean trade box directly on your chart. Instead of typing numbers in a calculator, you simply click on the chart to set your Entry, Target, and Stop levels, and the script builds a full trade map around them.
You define your Wallet Value and Risk % per trade, then the script automatically calculates:
Position size (Qty) based on distance from Entry to Stop
Total trade value
Monetary risk per trade
Potential profit and Risk:Reward ratio
Live open P&L as price moves
The trade is visualized as:
A green profit box between Entry and Target
A red risk box between Entry and Stop
Colored horizontal lines for Entry (blue), Target (green), and Stop (red)
Professional labels show detailed info:
Center label: P&L, Qty, Trade value, Risk $, R:R
Target label: distance to target, % move, potential profit $
Stop label: distance to stop, % risk, risk $
All label colors, text sizes, background transparency, and box width/offset can be customized from the settings, so you can adapt the tool to any chart style or theme.
The script also includes smart alerts that automatically follow your levels:
Entry Hit – when price touches your entry zone
Target Hit – when price touches your target
Stop Hit (3 closes) – when price has closed beyond your stop level for 3 consecutive bars (to avoid being faked out by a single wick)
You can either create separate alerts from the alertcondition() entries, or enable the “Use single combined alert()” option and set one alert with “Any alert() function call” so a single alert setup covers Entry, Target, and Stop events.
This tool is designed to help discretionary traders quickly plan trades, visualize risk vs reward on the chart, and keep position sizing consistent with their risk management rules.
You define your Wallet Value and Risk % per trade, then the script automatically calculates:
Position size (Qty) based on distance from Entry to Stop
Total trade value
Monetary risk per trade
Potential profit and Risk:Reward ratio
Live open P&L as price moves
The trade is visualized as:
A green profit box between Entry and Target
A red risk box between Entry and Stop
Colored horizontal lines for Entry (blue), Target (green), and Stop (red)
Professional labels show detailed info:
Center label: P&L, Qty, Trade value, Risk $, R:R
Target label: distance to target, % move, potential profit $
Stop label: distance to stop, % risk, risk $
All label colors, text sizes, background transparency, and box width/offset can be customized from the settings, so you can adapt the tool to any chart style or theme.
The script also includes smart alerts that automatically follow your levels:
Entry Hit – when price touches your entry zone
Target Hit – when price touches your target
Stop Hit (3 closes) – when price has closed beyond your stop level for 3 consecutive bars (to avoid being faked out by a single wick)
You can either create separate alerts from the alertcondition() entries, or enable the “Use single combined alert()” option and set one alert with “Any alert() function call” so a single alert setup covers Entry, Target, and Stop events.
This tool is designed to help discretionary traders quickly plan trades, visualize risk vs reward on the chart, and keep position sizing consistent with their risk management rules.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。