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
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。