PROTECTED SOURCE SCRIPT
Lot Size Calculator by MR1561

Overview
Size your position on GOLD (XAU) directly from your risk in USD and the two lines you place on the chart (Entry & Stop). The script measures that price distance, calculates the lot size, draws clear Risk/Reward boxes, and shows a clean 2-column table with: Risk, Entry, Stop, Target (from R/R), Lots, and Pips.
How to use
Step 1: Add the indicator to an XAU chart (e.g., XAUUSD).
Step 2: In Inputs, set your Risk $.
Step 3: Place/adjust the Entry and Stop lines on the chart.
Step 4: Read "Lots" in the table and trade with consistent sizing.
Features
- GOLD-only display (detects XAU symbols)
- Lot sizing from Risk $ and price distance (Entry vs Stop)
- Auto Target from R/R, plus Risk/Reward boxes
- Compact on-chart table (toggle rows: Risk, Entry, Stop, Target, Lots, Pips)
- Fully customizable colors, opacity, table position, frame/border width
- Lightweight and fast; designed for clean overlays
Inputs
- Risk $: your dollar risk per trade
- Entry Price, Stop Loss: adjustable lines on chart
- R/R: target is auto-calculated from risk distance and ratio
- Appearance - Boxes: colors & opacity for Risk/Reward areas
- Appearance - Table: position (top/bottom, left/right), alternating row colors, frame/border width
- Table - Rows: show/hide each row
- Appearance - Layout: horizontal span (bars) for lines/boxes
حجم معامله روی طلا (XAU) را مستقیماً از «ریسک دلاری» و دو خطی که روی چارت میگذارید (Entry و Stop) محاسبه میکند. فاصلهٔ قیمتی را اندازه میگیرد، حجم (لات) را حساب میکند، باکسهای Risk/Reward را رسم میکند و یک جدول دو ستونه از مقادیر مهم نشان میدهد: Risk، Entry، Stop، Target (از R/R)، Lots و Pips.
روش استفاده
اندیکاتور را روی چارت XAU (مثل XAUUSD) اضافه کنید.
در تنظیمات مقدار Risk $ را تعیین کنید.
خطوط Entry و Stop را روی چارت جابهجا/تنظیم کنید.
مقدار Lots را در جدول بخوانید و با سایز یکپارچه معامله کنید.
ویژگیها
نمایش فقط روی نمادهای XAU
محاسبهٔ حجم از روی Risk $ و فاصلهٔ قیمتی (Entry تا Stop)
محاسبهٔ خودکار Target بر اساس R/R و رسم باکسهای ریسک/ریوارد
جدول جمعوجور با امکان روشن/خاموش کردن سطرها (Risk, Entry, Stop, Target, Lots, Pips)
شخصیسازی کامل رنگها، شفافیت، موقعیت جدول و ضخامت قاب/بوردر
سبک و سریع؛ مناسب برای نمایش تمیز روی چارت
ورودیها
Risk $ (ریسک دلاری هر معامله)
Entry Price و Stop Loss (قابل تنظیم روی چارت)
R/R (تارگت بر اساس نسبت ریسک به ریوارد محاسبه میشود)
ظاهر – باکسها، ظاهر – جدول، جدول – ردیفها، ظاهر – چیدمان
Changelog
v1.0 - Initial public release (core lot sizing, risk/reward boxes, compact table, styling options)
Credits
Created by MohammadReza.
Size your position on GOLD (XAU) directly from your risk in USD and the two lines you place on the chart (Entry & Stop). The script measures that price distance, calculates the lot size, draws clear Risk/Reward boxes, and shows a clean 2-column table with: Risk, Entry, Stop, Target (from R/R), Lots, and Pips.
How to use
Step 1: Add the indicator to an XAU chart (e.g., XAUUSD).
Step 2: In Inputs, set your Risk $.
Step 3: Place/adjust the Entry and Stop lines on the chart.
Step 4: Read "Lots" in the table and trade with consistent sizing.
Features
- GOLD-only display (detects XAU symbols)
- Lot sizing from Risk $ and price distance (Entry vs Stop)
- Auto Target from R/R, plus Risk/Reward boxes
- Compact on-chart table (toggle rows: Risk, Entry, Stop, Target, Lots, Pips)
- Fully customizable colors, opacity, table position, frame/border width
- Lightweight and fast; designed for clean overlays
Inputs
- Risk $: your dollar risk per trade
- Entry Price, Stop Loss: adjustable lines on chart
- R/R: target is auto-calculated from risk distance and ratio
- Appearance - Boxes: colors & opacity for Risk/Reward areas
- Appearance - Table: position (top/bottom, left/right), alternating row colors, frame/border width
- Table - Rows: show/hide each row
- Appearance - Layout: horizontal span (bars) for lines/boxes
حجم معامله روی طلا (XAU) را مستقیماً از «ریسک دلاری» و دو خطی که روی چارت میگذارید (Entry و Stop) محاسبه میکند. فاصلهٔ قیمتی را اندازه میگیرد، حجم (لات) را حساب میکند، باکسهای Risk/Reward را رسم میکند و یک جدول دو ستونه از مقادیر مهم نشان میدهد: Risk، Entry، Stop، Target (از R/R)، Lots و Pips.
روش استفاده
اندیکاتور را روی چارت XAU (مثل XAUUSD) اضافه کنید.
در تنظیمات مقدار Risk $ را تعیین کنید.
خطوط Entry و Stop را روی چارت جابهجا/تنظیم کنید.
مقدار Lots را در جدول بخوانید و با سایز یکپارچه معامله کنید.
ویژگیها
نمایش فقط روی نمادهای XAU
محاسبهٔ حجم از روی Risk $ و فاصلهٔ قیمتی (Entry تا Stop)
محاسبهٔ خودکار Target بر اساس R/R و رسم باکسهای ریسک/ریوارد
جدول جمعوجور با امکان روشن/خاموش کردن سطرها (Risk, Entry, Stop, Target, Lots, Pips)
شخصیسازی کامل رنگها، شفافیت، موقعیت جدول و ضخامت قاب/بوردر
سبک و سریع؛ مناسب برای نمایش تمیز روی چارت
ورودیها
Risk $ (ریسک دلاری هر معامله)
Entry Price و Stop Loss (قابل تنظیم روی چارت)
R/R (تارگت بر اساس نسبت ریسک به ریوارد محاسبه میشود)
ظاهر – باکسها، ظاهر – جدول، جدول – ردیفها، ظاهر – چیدمان
Changelog
v1.0 - Initial public release (core lot sizing, risk/reward boxes, compact table, styling options)
Credits
Created by MohammadReza.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.