OPEN-SOURCE SCRIPT
Position Size Calculator (Jean-Guy)

Overview Most traders fail because they don't account for the "hidden" costs of trading [cite: 2026-02-09]. This indicator is a high-precision risk management tool designed to show you your True Net Result before you even click the "Buy" or "Sell" button.
By integrating exchange fees directly into the position sizing logic, this script reveals the gap between your theoretical profit and what actually hits your account.
Key Features • True Net R/R & P&L: Automatically calculates your Reward/Risk ratio and Profit/Loss by subtracting entry and exit fees. • Dual Risk Management: Choose to risk a fixed dollar amount ($) or a precise percentage (%) of your total bag. • Execution HUD: A clean table in the top-right corner displays Margin Required, Leverage, and Net Outcomes. • Optimized UI: Includes a "Safety Margin" row at the top to prevent TradingView's hover menu from hiding your R/R data. • High-Visibility Visuals: 90% opacity zones for entry/SL/TP to help you align with your market structure.
Advantages & Disadvantages
PROS ✅ • Fee Integration: Set your specific exchange fee % (default 0.1%). • Net Reality: Shows you that a $100 risk is actually a $108.1 loss after fees—keeping you disciplined. • Visual Alignment: The fixed box helps you stay focused on your Discount/Premium zones [cite: 2026-01-23].
CONS ❌ • Manual Input: Does not sync with TradingView's built-in Long/Short drawing tools. • Static Box: The visual representation remains at the current price area and doesn't scroll. • Initial Setup: Requires entering prices manually once before moving lines via settings.
How to use
Set your account balance and risk level.
Enter your Entry, Stop Loss, and Take Profit prices.
Check the R/R NET (in green). If it doesn't fit your strategy, skip the trade [cite: 2026-01-23].
Use the Margin Req. and Leverage data to fill your exchange order form exactly.
Update V2 :
- Added Lots/Units Display: The dashboard now calculates and shows the exact position size in Lots/Units for faster order execution.
- Fixed Opacity Bug: Implemented a forced cleanup logic (line.delete) to prevent color stacking. Your zones will now maintain a consistent transparency over time.
- New Default Visibility: Set the native opacity to 90 for a cleaner, non-intrusive look that keeps price action visible.
- Code Optimization: Improved script stability for the multi-asset backtesting phase
By integrating exchange fees directly into the position sizing logic, this script reveals the gap between your theoretical profit and what actually hits your account.
Key Features • True Net R/R & P&L: Automatically calculates your Reward/Risk ratio and Profit/Loss by subtracting entry and exit fees. • Dual Risk Management: Choose to risk a fixed dollar amount ($) or a precise percentage (%) of your total bag. • Execution HUD: A clean table in the top-right corner displays Margin Required, Leverage, and Net Outcomes. • Optimized UI: Includes a "Safety Margin" row at the top to prevent TradingView's hover menu from hiding your R/R data. • High-Visibility Visuals: 90% opacity zones for entry/SL/TP to help you align with your market structure.
Advantages & Disadvantages
PROS ✅ • Fee Integration: Set your specific exchange fee % (default 0.1%). • Net Reality: Shows you that a $100 risk is actually a $108.1 loss after fees—keeping you disciplined. • Visual Alignment: The fixed box helps you stay focused on your Discount/Premium zones [cite: 2026-01-23].
CONS ❌ • Manual Input: Does not sync with TradingView's built-in Long/Short drawing tools. • Static Box: The visual representation remains at the current price area and doesn't scroll. • Initial Setup: Requires entering prices manually once before moving lines via settings.
How to use
Set your account balance and risk level.
Enter your Entry, Stop Loss, and Take Profit prices.
Check the R/R NET (in green). If it doesn't fit your strategy, skip the trade [cite: 2026-01-23].
Use the Margin Req. and Leverage data to fill your exchange order form exactly.
Update V2 :
- Added Lots/Units Display: The dashboard now calculates and shows the exact position size in Lots/Units for faster order execution.
- Fixed Opacity Bug: Implemented a forced cleanup logic (line.delete) to prevent color stacking. Your zones will now maintain a consistent transparency over time.
- New Default Visibility: Set the native opacity to 90 for a cleaner, non-intrusive look that keeps price action visible.
- Code Optimization: Improved script stability for the multi-asset backtesting phase
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.