OPEN-SOURCE SCRIPT

Position Size Calculator v2

40
06/17/2025 - Updated to add MGC to list of instruments

Position Size Calculator for Futures Trading

A professional position sizing tool designed specifically for futures traders who want to maintain disciplined risk management. This indicator calculates the optimal number of contracts based on your predefined risk amount and provides instant visual feedback.

Key Features:
• Interactive price selection - simply click on the chart to set entry, stop loss, and take profit levels
• Supports all major futures contracts: ES, NQ, GC, RTY, YM, MNQ, MES with accurate contract specifications
• Customizable risk amount (defaults to $500 but fully adjustable)
• Real-time position size calculations that never exceed your risk tolerance
• Visual risk validation with color-coded header (green = valid risk, red = excessive risk)
• Automatic 2:1 risk/reward ratio calculations
• Compact, non-intrusive table display in top-right corner
• Clean interface with no chart clutter

How to Use:
Select your futures instrument from the dropdown
Set your maximum risk amount (default $500)
Click on the chart to set your Entry Price
Click on the chart to set your Stop Loss Price
Optionally click to set your Take Profit Price


The calculator instantly shows maximum contracts, actual risk, expected profit, and R/R ratio

Risk Management:
The indicator enforces strict risk management by calculating the maximum number of contracts you can trade while staying within your specified risk limit. The header turns green when your trade is within acceptable risk parameters and red when the risk is too high, providing instant visual feedback.

Perfect for day traders, swing traders, and anyone trading futures who wants to maintain consistent position sizing and risk management discipline.

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.