OPEN-SOURCE SCRIPT
Position Size Calculator

It calculates the risk per trade using two methods: Margin-Based (percentage of total Account Balance) or Equity-Based (percentage of Total Balance minus minimum balance). Displayed as a compact, customizable label on the main chart, it’s perfect for traders seeking quick, precise risk calculations.
Key Features
Two Calculation Options:
Margin-Based: Risk as a percentage (0-5%) of your total account balance.
Equity-Based: Risk as a percentage (0-50%) of (Total balance - Minimum balance).
Flexible Risk Input: Manually enter any risk percentage with 0.01% precision (e.g., 1.75%).
Customizable Display:
Repositionable table (9 positions, e.g., top-right, middle-center).
Four table sizes (XL, L, M, S) with text scaling (large, normal, small, tiny).
Adjustable cell color, text color, and transparency
Margin-Based Risk Calculation:
Set “Total Margin” (e.g., $10,000).
Enter “Risk Percentage (%)” (0 to 5%, e.g., 1.75%).
Equity-Based Risk Calculation:
Set “Total Equity” (e.g., $15,000).
Set “Minimum Balance” (e.g., $5,000).
Enter “Equity Risk Percentage (%)” (0 to 50%, e.g., 1.75%).
Display Settings:
Choose “Calculation Method” (Margin-Based or Equity-Based).
Select “Table Position” (e.g., top_right).
Select “Table Size” (XL, L, M, S; default M).
Customize “Table Cell Color”, “Table Text Color”, and “Table Cell Transparency”.
Key Features
Two Calculation Options:
Margin-Based: Risk as a percentage (0-5%) of your total account balance.
Equity-Based: Risk as a percentage (0-50%) of (Total balance - Minimum balance).
Flexible Risk Input: Manually enter any risk percentage with 0.01% precision (e.g., 1.75%).
Customizable Display:
Repositionable table (9 positions, e.g., top-right, middle-center).
Four table sizes (XL, L, M, S) with text scaling (large, normal, small, tiny).
Adjustable cell color, text color, and transparency
Margin-Based Risk Calculation:
Set “Total Margin” (e.g., $10,000).
Enter “Risk Percentage (%)” (0 to 5%, e.g., 1.75%).
Equity-Based Risk Calculation:
Set “Total Equity” (e.g., $15,000).
Set “Minimum Balance” (e.g., $5,000).
Enter “Equity Risk Percentage (%)” (0 to 50%, e.g., 1.75%).
Display Settings:
Choose “Calculation Method” (Margin-Based or Equity-Based).
Select “Table Position” (e.g., top_right).
Select “Table Size” (XL, L, M, S; default M).
Customize “Table Cell Color”, “Table Text Color”, and “Table Cell Transparency”.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。