OPEN-SOURCE SCRIPT
90% Buying Power Position Size Helper

90% Buying Power Position Size Helper — Script Description
This tool calculates a recommended share size based on your available buying power and the current market price. TradingView does not provide access to live broker balances, so this script allows you to manually enter your current buying power and instantly see how many shares you can buy using a chosen percentage of it (default: 90%).
How It Works
• Enter your Buying Power ($)
• Choose the Percent to Use (e.g., 90%).
• The script divides the selected portion of your buying power by the current price of the symbol.
• A small display in the chart corner shows the recommended number of shares to buy.
Formula
shares = floor((buying_power * percent_to_use / 100) / price)
What It’s For
• Day traders who size positions based on account buying power
• Traders who want a quick way to calculate share size per trade
• Anyone who sizes entries using a fixed percentage of their account
What It Doesn’t Do
Due to TradingView limitations, the script cannot:
• Read your live buying power or broker balance
• Auto-fill orders or submit trades
• Retrieve real account data from your broker
You simply update the buying power input whenever your account changes, and the script does the rest.
Why It’s Useful
• Keeps you consistent with position sizing
• Reduces manual math during fast trading
• Prevents oversizing or undersizing trades
• Helps maintain discipline and risk control
This tool calculates a recommended share size based on your available buying power and the current market price. TradingView does not provide access to live broker balances, so this script allows you to manually enter your current buying power and instantly see how many shares you can buy using a chosen percentage of it (default: 90%).
How It Works
• Enter your Buying Power ($)
• Choose the Percent to Use (e.g., 90%).
• The script divides the selected portion of your buying power by the current price of the symbol.
• A small display in the chart corner shows the recommended number of shares to buy.
Formula
shares = floor((buying_power * percent_to_use / 100) / price)
What It’s For
• Day traders who size positions based on account buying power
• Traders who want a quick way to calculate share size per trade
• Anyone who sizes entries using a fixed percentage of their account
What It Doesn’t Do
Due to TradingView limitations, the script cannot:
• Read your live buying power or broker balance
• Auto-fill orders or submit trades
• Retrieve real account data from your broker
You simply update the buying power input whenever your account changes, and the script does the rest.
Why It’s Useful
• Keeps you consistent with position sizing
• Reduces manual math during fast trading
• Prevents oversizing or undersizing trades
• Helps maintain discipline and risk control
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.