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.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarle liberamente e senza alcuna limitazione – ulteriori informazioni qui.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.