In Forex trading, the maximum quantity of units you can buy using margin is calculated as follows:
Capital * leverage = Maximum Quantity
For example:
If your account is in GBP and you wish to trade GBP/USD, and you have 5000 GBP capital with a leverage of 1:30:
5000 * (1:30) = approx. 150000 units of Forex.
If your account currency is different from the traded forex couple, for example, your account currency is GBP, and you wish to trade EUR/USD, the maximum quantity will be based on the exchange rate of GBP/EUR.
How to calculate the maximum quantity of other CFD instruments?
If you are trading any other instrument, the maximum quantity of units is calculated in the following way:
Price * % (MARGIN) = Leveraged Price
Capital/ leveraged Price = Maximum Quantity Units
For example:
If you would like to trade with a long 'Buy' position of Gold at $1,730, and you have $5000 capital with a margin of 5%:
$1,730 * (0.05) = $87.5
5000 / 87.5 = approx. 57 units of Gold.
If your account currency is different from the traded instrument, the relevant exchange rate at the time of your trade will apply.