OPEN-SOURCE SCRIPT
已更新 Net RR Calculator

Net RR Calculator — Risk/Reward Calculator with Net Commission.
A precision risk/reward tool for long and short positions that goes beyond structural RR by calculating your real, net RR after trading fees.
How it works:
Click three times on the chart — entry, stop loss, and take profit — and the indicator instantly draws your risk/reward zones and displays a full breakdown of the trade.
What it calculates:
- Structural RR (raw ratio without fees)
- Net RR (actual ratio after open & close commissions)
- Position size based on your deposit and risk percentage
- Commission cost for both winning and losing scenarios
- Net profit and risk amount in your chosen currency
Key features:
- Automatic Long / Short detection based on stop placement
- Separate commission inputs for open and close (maker/taker friendly)
- Supports USD, EUR, RUB and USDT display
- Fully customizable zone colors, width and decimal precision
- Clean, non-intrusive overlay with dark-themed labels
Who it's for:
Traders who want to see the true cost of a trade before entering — accounting for exchange fees that silently erode your RR on every position.
A precision risk/reward tool for long and short positions that goes beyond structural RR by calculating your real, net RR after trading fees.
How it works:
Click three times on the chart — entry, stop loss, and take profit — and the indicator instantly draws your risk/reward zones and displays a full breakdown of the trade.
What it calculates:
- Structural RR (raw ratio without fees)
- Net RR (actual ratio after open & close commissions)
- Position size based on your deposit and risk percentage
- Commission cost for both winning and losing scenarios
- Net profit and risk amount in your chosen currency
Key features:
- Automatic Long / Short detection based on stop placement
- Separate commission inputs for open and close (maker/taker friendly)
- Supports USD, EUR, RUB and USDT display
- Fully customizable zone colors, width and decimal precision
- Clean, non-intrusive overlay with dark-themed labels
Who it's for:
Traders who want to see the true cost of a trade before entering — accounting for exchange fees that silently erode your RR on every position.
版本注释
Release Notes — v1.1▶ NEW: Position sizing display
Two new lines added to the main info panel: Position — trade size in the selected deposit currency (USDT / USD / EUR / RUB), and Quantity — number of units of the chart's base asset (e.g. 0.5066 GOLD, 12 AAPL, 0.0234 BTC). The asset name is taken automatically from the chart symbol via syminfo.basecurrency, with a ticker fallback for stocks. Quantity formatting adapts to the value: 2 decimals for ≥100 units, 4 for 1–100, 6–8 for fractional crypto sizes.
▶ NEW: Toggle for the position block
"Show position size (currency + asset quantity)" checkbox added in the Visuals group. Disable it if you only need RR / PnL info.
▶ CHANGE: Position sizing now includes commissions inside the risk budget
Position size is now calculated so that the actual loss at stop loss — price move plus open and close commissions — equals the configured risk % of the deposit in full, rather than only the price-move loss as before. The "Risk: -X USDT" line now reflects the true maximum loss from the account. Structural RR and Net RR ratios are unchanged — only the position-sizing formula was updated.
▶ MINOR: Added division-by-zero guards for qty and Net RR when the entry / SL / TP points have not yet been placed on the chart.
版本注释
Release Notes — v1.2▶ TWEAK: Added breathing room between the chart and the risk/reward zones
The risk and reward zones now start 5 bars to the right of the current bar instead of beginning right at it, matching the existing 5-bar gap between the zones and the info panel on the right. The result is symmetric padding around the tool: chart → 5 bars → zones → 5 bars → info panel. Zone width and info-panel placement are unchanged.
版本注释
Release Notes — v1.3► NEW: Added required leverage to the info panel
The info panel now shows the required leverage directly below the Quantity line. Leverage is calculated as position size divided by deposit (e.g. a $5 000 position on a $1 000 deposit = 5x). The value updates automatically alongside all other position metrics. Visible only when "Show position size" is enabled.
► TWEAK: Updated tooltip for "Show position size"
The tooltip now mentions leverage in addition to currency amount and asset quantity, reflecting the new info panel output.
版本注释
Release Notes — v1.4▶ NEW: Added "Account Balance" field with toggle for real-leverage calculation
A new "Account Balance" input has been added below "Trading Deposit", controlled by a "Use Account Balance" checkbox (disabled by default). Enable it when your real account balance is smaller than the trading deposit you size positions against — leverage will then be calculated as position size divided by the account balance, reflecting the actual margin requirement on the exchange (e.g. a 692.71 USDT position on a 300 USDT real balance = 2.31x). When the checkbox is off, leverage continues to use the trading deposit as before.
▶ TWEAK: Renamed "Deposit" to "Trading Deposit"
The primary capital input has been renamed to "Trading Deposit" to make its role explicit: it is the notional amount used to size positions and calculate the risk percentage, which may differ from the actual funds on the account. All risk calculations remain unchanged — only the label has been clarified.
▶ TWEAK: Info panel now reflects both deposit and balance
The info panel always shows "Trading Deposit". When "Use Account Balance" is enabled, an additional "Account Balance" line appears directly below it, so both the sizing base and the leverage base are visible at a glance.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。