Gold Position Size Calculator (XAUUSD) for MT5
Info
The Gold Position Size Calculator (XAUUSD) for MT5 is a Indicator for MetaTrader 5 that gold position size calculator (xauusd) is a free risk management indicator for metatrader 5, designed specifically for gold traders. Most retail gold traders lose money not because of bad entries, but because of wrong position sizes.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Gold Position Size Calculator (XAUUSD) for MT5
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
Gold Position Size Calculator (XAUUSD) is a free risk management indicator for MetaTrader 5, designed specifically for gold traders.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Prop Firm Risk Calculator: Position Sizing and Loss Limits - another powerful indicator for MetaTrader 5 traders.
Gold Position Size Calculator (XAUUSD) is a free risk management indicator for MetaTrader 5, designed specifically for gold traders.Also recommended: Turtle Breakout Indicator Performance Analysis on Gold (2025-2026) - similar indicator with strong performance on MetaTrader 5.
Most retail gold traders lose money not because of bad entries, but because of wrong position sizes. Risking a fixed lot size on XAUUSD means every trade carries a different, unknown risk. This indicator applies the classic risk-based position sizing formula: Lot size = (Balance x Risk %) / (Stop distance in points x Tick value per lot), so that if the stop-loss is hit, the loss equals exactly the chosen percentage of the account - no more, no less.
How it works
- Attach the indicator to a Gold (XAUUSD) chart. It works on any timeframe.
- Set your account balance and risk per trade (%).
- Enter your entry price (or leave 0 to use the current price) and your stop-loss price.
- Optionally set a take-profit price.
- Read the calculated lot size from the panel - that is the position size that risks exactly your chosen % if the stop is hit.
The panel shows: balance, risk %, risk amount, stop distance in points, calculated lot size, risk/reward ratio and potential profit. Entry, stop-loss and take-profit lines are drawn directly on the chart.
External variables (inputs)
- InpAccountBalance - account balance used in the calculation
- InpRiskPercent - risk per trade in percent of the balance
- InpEntryPrice - planned entry price (0 = current close)
- InpStopPrice - stop-loss price (0 = not set)
- InpTakeProfit - take-profit price (0 = not set)
- InpContractSize - contract size per 1.00 lot (0 = read automatically from the symbol specification)
- InpShowLines - show or hide entry, stop and TP lines
- InpShowPanel - show or hide the info panel
- InpPanelCorner - panel corner
Notes
- Contract size is read automatically from the broker's symbol specification, so the indicator works on XAUUSD, XAUUSDm, gold futures and any other instrument without manual setup.
- The math is non-repainting: values are recalculated only when inputs change or a new bar opens.
- This is a risk calculation tool, not a signal service: it does not open trades and does not promise profits.
A Pro version with one-click execution, break-even, trailing stop and partial close is in development (expected 2026).
You may also like: CME Gap Tracker for Gold and Bitcoin: Analysis of Open Gaps, Fill Rates, and Fade-Trade Performance - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property version "1.10"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3
#property indicator_label1 "Entry"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrDodgerBlue
#property indicator_style1 STYLE_SOLID
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.