Gold is the instrument where brokers agree about almost nothing. The symbol may be XAUUSD, GOLD, XAUUSD.m, XAUUSDpro or GOLD#. One contract may hold 100 ounces, or 10, or one. The price may carry two digits or three. An EA that works out its lot size from a hardcoded "100 ounces, two digits" is not slightly wrong on the next broker - it is wrong by a factor of ten, in the direction that empties the account.

This class asks the terminal instead of assuming.

Detection. Detect() walks every symbol the account offers and scores the names, so XAUUSD wins over XAUUSD.m, which wins over a loose match, while silver, platinum and palladium are excluded outright - XAGUSD must never win a search for gold. A symbol already in Market Watch gets a small bonus. If your broker uses something unusual, Attach("YOURNAME") skips the search.

Specification. ContractSize(), Digits(), Point(), TickSize(), TickValueLoss(), MinLot(), MaxLot(), LotStep(), StopsLevel() and FreezeLevel() come straight from the terminal for that symbol.

Money. LossForDistance(lots, distance) says what a move against you costs in the currency of the account. LotForRisk(riskMoney, distance) is the reverse and the one that matters: it converts through SYMBOL_TRADE_TICK_VALUE_LOSS, so it stays correct on a 10-ounce contract and on a euro-denominated account, then rounds the result down onto the broker's volume step and into its min and max. It returns zero rather than a silent minimum lot when even the smallest volume would risk more than you allowed - a case most sizing code gets wrong by rounding up.

Diagnostics. Attach() collects warnings for a contract size that is not 100, an unusual number of digits, a tick value the terminal reports as zero, and a non-zero stops level. PrintReport() prints the whole specification with a worked example, which is usually the fastest way to find out why a strategy behaves differently on two brokers.

On a live account with a 100-ounce contract, a euro balance and a 1500-point stop, 1 % of 10 000 EUR comes out as 0.07 lots risking 90.42 EUR. The same call on a 10-ounce contract returns 0.70 lots, and on a one-ounce contract 7.00 lots. Same risk, same stop, a hundredfold difference in volume - which is exactly what a hardcoded constant gets wrong.

The package includes GoldSymbolDemo.mq5, a script that detects the gold symbol, prints the report and converts a percentage of the balance into a lot size over several stop distances. Run it on any chart to see what your own broker's gold really is.

The class opens no trades and modifies no positions. It answers questions.