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が提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。