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
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.