OPEN-SOURCE SCRIPT
Position Size Calculator

A simple on-chart position sizing tool. Enter your account size and risk percentage, click your stop-loss (and optionally a target) directly on the chart, and the table shows the position size that keeps your loss at the chosen risk amount if the stop is hit.
How it works
Position size = (account size x risk %) / distance between entry and stop. Entry defaults to the current price, or can be set manually. If a target is set, the reward-to-risk ratio is also displayed. Stop and target levels are drawn on the chart, and the table position is configurable.
Notes and limitations
Sizes are expressed in instrument units; for forex, convert units to lots according to your broker's contract size, and note that P&L currency conversion is not performed. Fees, slippage and gaps are not modeled — a stop-loss order does not guarantee the stop price in fast markets. This is a calculation aid, not trade advice.
How it works
Position size = (account size x risk %) / distance between entry and stop. Entry defaults to the current price, or can be set manually. If a target is set, the reward-to-risk ratio is also displayed. Stop and target levels are drawn on the chart, and the table position is configurable.
Notes and limitations
Sizes are expressed in instrument units; for forex, convert units to lots according to your broker's contract size, and note that P&L currency conversion is not performed. Fees, slippage and gaps are not modeled — a stop-loss order does not guarantee the stop price in fast markets. This is a calculation aid, not trade advice.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.