CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

# The Basics of Margin Trading

A spread is the difference between the bid price and the ask price. Spreads differ from broker to broker.
To calculate the cost of a spread on the Quadcode Markets platform, use the following formula:

### Example

Spread: 1.13462 - 1.13455 = 0.00007
Trade size: 200.000 units of the base currency (=200,000 EUR)
EUR/USD cost of spread = (1.13462 - 1.13455) × 200,000 = 14 USD

## Swaps

A swap is an interest charge that a trader must pay to a broker for holding positions overnight.
Swaps arise from the difference in interest rates of currencies plus the broker's administrative fee. In forex trading, you borrow one currency in order to buy another. A swap depends on whether you buy a currency with a higher or lower interest rate compared to that of the currency you borrow. Swaps can be both positive and negative.
If you buy a currency with a higher interest rate than the one you are borrowing, you will get a positive swap. Let's consider the following example.

### Example

The American interest rate is 1.75%.
Australia's interest rate is 0.75%.
If you open a long position on the USD/AUD pair, a swap of 0.75% will be credited to your account, as the currency you buy (USD) has a higher interest rate than the currency you borrow (AUD).
If you open a short position on the same currency pair, a swap of 1.25% will be debited from your account, because the currency you borrow (USD) has a higher interest rate than the currency you buy (AUD).

## Margin

Margin is the amount of a trader's funds required to open a leveraged position. Margin allows you to trade with leverage, which is essentially using borrowed funds from a broker in order to increase the size of your trades.
To calculate a margin on the Quadcode Markets platform, use the following formula:

Margin = Trade size / Leverage

### Example

You intend to buy 1,000 units of the EUR/USD currency pair with a 1:30 leverage. The margin required to open this trading position is 3.33 EUR. Check out the detailed calculations below:

Currency pair: EUR/USD
Trade size: 1000 units of the base currency
Leverage: 1:30
Margin = 1000 / 30 = 3.33 EUR

Please note that conversion may occur if your account currency is different from the base currency.

## Leverage

Leverage allows you to trade positions larger than the amount of capital you possess. Leverage maximizes payouts, but it also maximizes losses.

### Example

Let's assume you have deposited \$1,000 into your account and are using a 1:30 leverage. In this case, your buying power will increase by 30 times, to \$30,000, which means you can place a trade with a value of \$30,000.

Please note that leverage varies for different assets.

Check out maximum leverage and margin requirements on the Quadcode Markets platform.

## Conversions

In some cases, currency conversion rates may apply. This is due to the fact that each parameter of a trade is denominated in either the base currency or the quote currency. The contract size and margin are denominated in the base currency, while the payout is always calculated in the quote currency. Therefore, currency conversion rates may apply to the calculation of margin and payouts. If your account currency differs from the quote currency, conversions will apply. Let's look at the following examples to understand when currency conversions may be required.

### Example 1: Base Currency = Account Currency

Let's say your account currency is USD and you are trading the USD/JPY currency pair. Conversion does not apply to the margin calculation because the base currency (USD) is the same as the account currency (USD). Conversion is applied when calculating the payout: it is first calculated in JPY, the quote currency, and then converted to USD, the account currency.

### Example 2: Quote Currency = Account Currency

Let's say your account currency is USD and you are trading the EUR/USD currency pair. Conversion will be applied to the margin calculation because the base currency (EUR) is different from the account currency (USD). Conversion doesn't apply to the calculation of payouts, because the quote currency (USD) is the same as the account currency (USD).

### Example 3: No matches

Let's say your account currency is GBP and you are trading the AUD/CHF currency pair. Conversion will be applied to the margin calculation because the account currency (GBP) is different from the base currency (AUD). Conversion is also applied when calculating payouts: they are first calculated in CHF, the quote currency, and then converted to GBP, the account currency.

## Margin level

Margin level helps you monitor your account health: it shows whether everything is going well or not and suggests when you should close positions that are not profitable.
To calculate your margin level, use the following formula:

Margin level = Equity / Margin × 100%

Everything is indicated in the account currency.

## Margin call and Stop out

### Margin Call

When a trader's margin level falls below 100%, the broker initiates a procedure known as a margin call. In the event of a margin call, the trader is required to either deposit more money into his/her account or close losing positions. If the margin level falls below 50%, losing positions will be forcibly closed by the company.

### Maintenance margin

Maintenance margin is the minimum amount of capital a trader must have in his or her account in order to keep a leveraged position open.

### Stop out

A stop out is an event that occurs when a trader's equity is not sufficient to maintain open positions, hence they get forcibly closed by the broker.