OPEN-SOURCE SCRIPT
Position Sizer

Position Sizer
A clean, lightweight position sizing calculator that lives directly on your chart. Instantly tells you how many shares to buy or sell based on your risk amount and stop loss — no more manual math before every trade.
How It Works
Set your Risk Amount ($) and Stop Loss Price in the settings. The indicator uses the live market price as your entry by default and calculates everything in real time:
Shares — exact number of shares/units to trade
Position Value — total capital deployed (shares × live price)
Direction — automatically detects LONG ▲ or SHORT ▼ based on your entry vs stop loss
Features
📌 Fixed $ Risk — enter the exact dollar amount you're willing to lose on the trade
📈 Live Price Entry — uses the current market price automatically; override anytime with a custom entry
🎯 Auto Direction — detects Long or Short from your entry/stop setup
🖥️ Fully Customizable Box — move to any corner, adjust text size, and change all colors to match your chart theme
⚡ Zero Lag — updates on every bar close in real time
Settings
Setting Description
Risk Amount ($) How much you're risking on the trade (default: $250)
Entry Price Leave at 0 to use live price, or set a specific entry
Stop Loss Price Your stop loss level
Horizontal / Vertical Position Move the box to any corner
Text Size Tiny, Small, Normal, Large
Colors Fully customizable box, border, labels, and values
How to Use
Add the indicator to your chart
Open Settings → Inputs
Set your Risk Amount and Stop Loss Price
Read your position size directly from the box on the chart
Built for traders who manage risk with a fixed dollar amount per trade. Works on Stocks and Crypto.
A clean, lightweight position sizing calculator that lives directly on your chart. Instantly tells you how many shares to buy or sell based on your risk amount and stop loss — no more manual math before every trade.
How It Works
Set your Risk Amount ($) and Stop Loss Price in the settings. The indicator uses the live market price as your entry by default and calculates everything in real time:
Shares — exact number of shares/units to trade
Position Value — total capital deployed (shares × live price)
Direction — automatically detects LONG ▲ or SHORT ▼ based on your entry vs stop loss
Features
📌 Fixed $ Risk — enter the exact dollar amount you're willing to lose on the trade
📈 Live Price Entry — uses the current market price automatically; override anytime with a custom entry
🎯 Auto Direction — detects Long or Short from your entry/stop setup
🖥️ Fully Customizable Box — move to any corner, adjust text size, and change all colors to match your chart theme
⚡ Zero Lag — updates on every bar close in real time
Settings
Setting Description
Risk Amount ($) How much you're risking on the trade (default: $250)
Entry Price Leave at 0 to use live price, or set a specific entry
Stop Loss Price Your stop loss level
Horizontal / Vertical Position Move the box to any corner
Text Size Tiny, Small, Normal, Large
Colors Fully customizable box, border, labels, and values
How to Use
Add the indicator to your chart
Open Settings → Inputs
Set your Risk Amount and Stop Loss Price
Read your position size directly from the box on the chart
Built for traders who manage risk with a fixed dollar amount per trade. Works on Stocks and Crypto.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。