OPEN-SOURCE SCRIPT
Diupdate Lot Size Calculator

Lot Size Calculator for Gold (XAU)
This indicator helps traders calculate the proper lot size for Gold (XAU) based on their entry, stop loss, and risk amount in USD.
You can set your entry and stop levels directly on the chart, and adjust your dollar risk from the settings panel.
The indicator measures the distance between entry and stop to calculate the position size that matches your selected risk.
A clean, customizable table displays key values such as Risk, Entry, Stop, Target, Lots, and Pips.
You can easily hide specific rows, change colors, and adjust layout options to fit your chart style.
Designed specifically for Gold traders, this tool provides a simple and visual way to manage risk directly on the chart.
This indicator helps traders calculate the proper lot size for Gold (XAU) based on their entry, stop loss, and risk amount in USD.
You can set your entry and stop levels directly on the chart, and adjust your dollar risk from the settings panel.
The indicator measures the distance between entry and stop to calculate the position size that matches your selected risk.
A clean, customizable table displays key values such as Risk, Entry, Stop, Target, Lots, and Pips.
You can easily hide specific rows, change colors, and adjust layout options to fit your chart style.
Designed specifically for Gold traders, this tool provides a simple and visual way to manage risk directly on the chart.
Catatan Rilis
Lot Size Calculator for GoldThis indicator is designed exclusively for the XAUUSD symbol and will not activate on any other instrument.
It calculates the exact lot size needed so that a trade from Entry to Stop-Loss risks exactly the USD amount specified by the user.
Calculation formula
SL distance = |Entry price − Stop-Loss price|
Lot size = Risk in USD ÷ (SL distance × 100)
Features
- Works only on XAUUSD (automatically disabled on all other symbols)
- Entry and Stop-Loss prices are set by clicking directly on the chart
- Target price is calculated automatically based on user-defined Risk:Reward ratio (default 1:1)
- Visual elements: red box (risk zone), green box (reward zone), horizontal lines for Entry/Stop/Target
- Customizable table displaying: Risk ($), Entry, Stop, Target, Lots, Pips
- Full control over table position, colors, transparency and row visibility
How to use
- Apply the indicator to any XAUUSD chart
- When the indicator is first added, two pop-ups will appear — click on the chart to set Entry price first, then click again to set Stop-Loss price
- Set your desired Risk amount in USD in the settings (default $50)
- (Optional) Adjust the "R:R" input to change the Risk:Reward ratio — Target price will update automatically (default 1:1)
- Read the calculated Lot size from the table and use that exact volume in your broker
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.