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
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.