Terms and Formulas in Margin trading
Balance
Balance represents the total funds available in a single-currency account, designated for isolated trades, spot market transactions, and long options positions.
Margin
The amount of cryptocurrency required to open a position. It is a fraction of the total trade size and acts as collateral for the position.
Initial Margin
The amount of cryptocurrency required to open a new position. It is determined by the leverage ratio.
Formula:Initial Margin = Trade Size / Leverage
Maintenance Margin
The minimum amount of cryptocurrency that must be maintained in the margin account to keep a position open. If the account balance falls below this level, the position is at risk of liquidation.
Formula:Maintenance Margin = Initial Margin * Maintenance Margin Ratio
Margin Call
A notification to the trader that the margin account balance has fallen below the maintenance margin requirement, and additional funds must be deposited to avoid liquidation.
Liquidation
The process of automatically closing a position when the margin account balance falls below the maintenance margin requirement to prevent further losses.
Realized P&L (Profit and Loss)
The actual profit or loss incurred from closing a position.
Formula:Realized P&L = (Exit Price – Entry Price) * Position Size
Unrealized P&L (Profit and Loss)
The current profit or loss of an open position based on the current market price.
Formula:Unrealized P&L = (Current Market Price – Entry Price) * Position Size
Free Margin
The amount of cryptocurrency available to open new positions.
Formula:Free Margin = Equity – Used Margin
Used Margin
The total amount of margin currently being used to maintain open positions.
Formula:Used Margin = Sum of Initial Margin for all open positions
Margin Level
An indicator of the health of the margin account, calculated as the ratio of equity to used margin.
Formula:Margin Level = (Equity / Used Margin) * 100%
Leverage Ratio
The ratio of the total position size to the margin required. Higher leverage allows for larger positions with a smaller initial margin.
Formula:Leverage Ratio = Trade Size / Initial Margin
Margin Requirement for new position
The margin needed to open a new position based on the leverage ratio and trade size.
Formula:Margin Requirement = Trade Size / Leverage
Equity Calculation
The total value of assets in the margin account, including cash balance and unrealized P&L.
Formula:Equity = Account Balance + Unrealized P&L
Total Equity
The net value of all cryptocurrency assets in the user account, converted into fiat currency.
Formula:Total Equity = Sum (Currency Equity * Currency Price)
Risk Ratio
A measure of the risk exposure of the margin account. It compares the used margin to the equity.
Formula:Risk Ratio = Used Margin / Equity
Position Size
The amount of cryptocurrency involved in a trade. It is determined by the trade size and the leverage used.
Formula:Position Size = Trade Size * Leverage
Entry Price
The price at which a position is opened.
Exit Price
The price at which a position is closed.
Liquidation Price
The price at which a position will be automatically closed due to insufficient margin.
Formula:Liquidation Price = Entry Price – (Initial Margin / Position Size)
Margin Utilization
The percentage of the margin that is currently being used. It helps in understanding how much of the available margin is in use.
Formula:Margin Utilization = (Used Margin / Equity) * 100%
Margin Excess
The amount of available margin above the required margin.
Formula:Margin Excess = Free Margin – Maintenance Margin
Example 1: Calculating initial margin and maintenance margin
Trade Size: 50 ETH Leverage: 5x Maintenance Margin Ratio: 20%
Initial Margin Calculation:
Initial Margin = Trade Size / Leverage
Initial Margin = 50 ETH / 5
Initial Margin = 10 ETH
Maintenance Margin Calculation:
Maintenance Margin = Initial Margin * Maintenance Margin Ratio
Maintenance Margin = 10 ETH * 0.20
Maintenance Margin = 2 ETH
Example 2: Calculating free margin and margin level
Account Balance: 30 ETH Unrealized P&L: 6 ETH Used Margin: 12 ETH
Equity Calculation: Equity = Account Balance + Unrealized P&L
Equity = 30 ETH + 6 ETH
Equity = 36 ETH
Free Margin Calculation:
Free Margin = Equity – Used Margin
Free Margin = 36 ETH – 12 ETH
Free Margin = 24 ETH
Margin Level Calculation:
Margin Level = (Equity / Used Margin) * 100%
Margin Level = (36 ETH / 12 ETH) * 100%
Margin Level = 300%
Example 3: Calculating liquidation price
Entry Price: 3,000 USDT/ETH Initial Margin: 10 ETH Position Size: 50 ETH
Liquidation Price Calculation:Liquidation Price = Entry Price – (Initial Margin / Position Size)
Liquidation Price = 3,000 – (10 / 50)
Liquidation Price = 3,000 – 0.2
Liquidation Price = 2,999.80 USDT/ETH
Trading Rules. Terminology Outlined
Assets:
Assets refer to the financial instruments or commodities that a trader holds in their account.
Available Asset:
The available asset is the portion of an asset that is not currently committed to any open positions or trading activities.
Positions:
Positions represent the open trades that a trader has in the market.
Long Position:
A long position is established when a trader buys an asset with the expectation that its price will rise.
Short Position:
A short position is taken when a trader sells an asset that they do not own, with the expectation that its price will fall. The trader profits if the asset’s price decreases and incurs a loss if the price increases.
Single-Currency margin account
Users can trade in either cross margin mode or isolated margin mode. In cross margin mode, all trading products settled with the same currency can share the same total margin, and profits and losses can be offset. In isolated margin mode, the risk and profit/loss of each position are separated.
- Equity and Balance Requirements:
For Futures, Perpetual, Short Options, and Margin Trades:
The available equity in the account must be equal to or greater than the amount required for the trade. This ensures that there are sufficient funds to cover the potential risks and obligations associated with these types of trades.
For Spot Trades or Long Options:
The available balance in the account must be equal to or greater than the amount required for the trade. This requirement is necessary to ensure that the funds are readily available to complete the transaction without the need for additional margin.
- Definition of Available Balance:
The available balance is the amount of assets that can be used for opening isolated positions and for performing spot and long options trades within a single-currency account. It represents the liquid portion of the account that is not tied up in existing positions or pending orders.
- Margin Verification Example:
Long Position with Leverage:
When a user decides to open a long position with 200 ETH using 5x leverage, the required margin is calculated by dividing the position size by the leverage, resulting in 40 ETH (200 / 5 = 40 ETH).
Assuming the user’s cross margin account has a balance of 700 ETH, the margin required for all existing and pending positions totals 530 ETH.
The available equity is calculated using the formula:
Equity = max(0, balance in cross margin account + Unrealized P&L – Utilized Amount)
Equity = max(0, 700 + 10 + 5 – 530) = 185 ETH
If the available equity (185 ETH) exceeds the required margin (40 ETH), the order can be successfully placed, indicating that the account has enough funds to support the new position.
4.Futures Trading Example
Futures trade with weekly contracts:
Let’s assume the current price of ETH is 3,000 USDT. For a futures trade involving 100,000 weekly contracts at this price with 5x leverage, the required margin is calculated as follows:
Required margin = (face value * number of contracts * contract multiplier) / order price / leverage multiplier
Substituting the values:Required margin = (100,000 * 100 * 1) / 3,000 / 5 = 666.67 ETH
Given the user’s account balance of 700 ETH and a total on-hold margin requirement of 530 ETH, the available equity remains:
Equity = max(0, balance in cross margin account + Unrealized P&L – in use margin) = max(0, 700 + 10 + 5 – 530) = 185 ETH
Since the available equity (185 ETH) is less than the required margin (666.67 ETH), the order cannot be placed. This illustrates the importance of having sufficient available equity to meet the margin requirements for new trades.
Profit and Loss (P&L) Calculation Formulas
- Long Positions (trading currency as margin currency):
P&L=(Sf−Si)×V,
Where: Sf = Final price of the asset Si = Initial price of the asset V = Volume of the asset
- Long Positions (quote currency as margin currency): P&L=(Sf−Si)×V
- Short Positions (quote currency as margin currency): P&L=(Si−Sf)×V
- Short Positions (trading currency as margin currency): P&L=(Si−Sf)×V
P&L Ratio
P&L Ratio=Initial InvestmentP&L
Initial Margin Requirements
- Long Positions (trading currency as margin currency, liability in quote currency):
Initial Margin=V×Si×Initial Margin Rate
- Short Positions (trading currency as margin currency, liability in quote currency):
Initial Margin=V×Si×Initial Margin Rate
- Short Positions (quote currency as margin currency, liability in trading currency):
Initial Margin=V×Si×Initial Margin Rate
- Long Positions (quote currency as margin currency, liability in quote currency):
Initial Margin=V×Si×Initial Margin Rate
Maintenance Margin Requirements
- Long Positions (trading currency as margin currency):
Maintenance Margin=V×Si×Maintenance Margin Rate
- Long Positions (quote currency as margin currency):
Maintenance Margin=V×Si×Maintenance Margin Rate
- Short Positions (quote currency as margin currency):
Maintenance Margin=V×Si×Maintenance Margin Rate
- Short Positions (trading currency as margin currency):
Maintenance margin=V×Si×Maintenance margin rate
Explanation
V = Volume or number of units of the asset being traded. Si = Initial price of the asset. Sf = Final price of the asset.
Initial Margin Rate = The percentage of the position’s value that must be held as collateral.
Maintenance Margin Rate = The percentage of the position’s value that must be maintained in the account to avoid a margin call.
Principle of Initial Margin
The initial margin is the amount of collateral that a trader must deposit to open a leveraged position.It is calculated as a percentage of the total value of the position.
Formula:Initial Margin=LeverageNotional Value of Position
Where:
Notional Value of Position=Quantity of Asset×Price of Asset
Leverage is the ratio by which the trader’s funds are multiplied to open a larger position.
Example 1: BTC/USDT Trading Pair
When trading the BTC/USDT pair, various assets can be chosen as collateral, depending on the exchange’s offerings.
Commonly used assets include: BTC (Bitcoin) USDT (Tether) USD (US Dollar)
Example 2: Open a Long Position with 5x Leverage
Let’s say a trader wants to open a long position of 1 BTC using 5x leverage, with BTC as the margin currency.
Calculate the Notional Value of the Position:
Assuming the current price of BTC is $30,000:
Notional Value of Position=1BTC×30,000USDT=30,000USDT
Determine the Initial Margin Required:
Using 5x leverage, the initial margin required is:
Initial Margin=530,000USDT=6,000USDT
If BTC is used as the margin currency, we need to convert the margin requirement back to BTC:
Initial Margin in BTC=30,000USDT/BTC6,000USDT=0.2BTC
Long Position opening process
Deposit Margin: The trader deposits the required initial margin (0.2 BTC) into their trading account.
Place Order: The trader places an order to buy 1 BTC using 5x leverage. The exchange holds the margin amount (0.2 BTC) as collateral.
Execute Trade: The trade is executed, and the trader now holds a long position of 1 BTC.
Monitor Position: The trader must monitor their position and maintain the required margin. If the value of BTC decreases, the trader may need to deposit additional margin to avoid a margin call or liquidation.
Closing Positions
Closing positions refers to the process of liquidating an open trade. This action finalizes the trade, locking in any realized profits or losses. Closing a position involves executing a trade opposite to the one that was initially opened: selling an asset that was bought (long position) or buying back an asset that was sold (short position).
Principle of Closing Positions
The principle of closing positions revolves around the idea of reversing the initial trade to realize profits or losses. For a long position, this means selling the asset that was initially bought. For a short position, it means buying back the asset that was initially sold. The primary goal is to exit the market at a favorable price to maximize gains or minimize losses.
- a) Closing Long positions with liability calculated in quote currency
When closing a long position, the liability (the amount needed to settle the position) is calculated in the quote currency (e.g., USDT in a BTC/USDT pair).
Initial Trade: Open Long Position: Buy Q BTC at price P USDT/BTC.
Notional Value=Q×P
Closing Trade: Sell Q BTC at the closing price Pclose USDT/BTC.
Proceeds from Sale=Q×Pclose
Profit/Loss Calculation: Profit/Loss=Q×(Pclose−P)
- b) Closing Short Positions with Liability Calculated in Trading Currency
When closing a short position, the liability is calculated in the trading currency (e.g., BTC in a BTC/USDT pair).
Initial Trade: Open Short Position: Sell Q BTC at price P USDT/BTC.
Proceeds from Sale=Q×P
Closing Trade:Buy back Q BTC at the closing price Pclose USDT/BTC.
Cost to Buy Back=Q×Pclose
Profit/Loss Calculation:
Profit/Loss=Q×(P−Pclose)
Closing positions means reversing an initial trade to realize gains or losses.The principle of closing positions involves executing an opposite trade to the one initially opened.
Isolated margin confines risk to a specific position, whereas cross margin allows the entire account balance to meet margin requirements.
Closing long positions with liability in quote currency involves selling the asset and calculating profits/losses based on the difference between the purchase and selling prices.
Closing short positions with liability in trading currency involves buying back the asset and calculating profits/losses based on the difference between the selling and repurchase prices.
If Equity ≥ Account Initial Margin
When the equity is greater than or equal to the account’s initial margin requirement, the available asset for closing margin positions is determined by the amount of equity and the liabilities of the open positions.
Available Asset=Equity−Initial Margin
If Equity < Account Maintenance Margin
When the equity is less than the account’s maintenance margin requirement, the available asset for closing margin positions is reduced, as additional funds or assets may be needed to meet the margin call and avoid liquidation.
Available Asset=Equity−Maintenance Margin
Closing Short Positions with Equity ≥ Initial Margin:
Closing Positions when assets and margin currencies are different
When the asset being traded and the margin currency are different, additional steps are needed to ensure proper conversion and calculation of the available assets for closing positions. The principle remains the same: reversing the initial trade to realize profits or losses, but it involves currency conversion.
Principle of closing positions:
The principle of closing positions involves selling the asset that was bought (for a long position) or buying back the asset that was sold (for a short position). When the asset and margin currency are different, the available asset that can be used to close the position equals the position assets converted into the margin currency at the current exchange rate.
The available asset that can be used to close the position = position assets converted into the margin currency.
Rules
- a) Closing Long Positions with liability calculated in quote currency (different margin currency)
Identify the Long Position: Determine the amount of the asset (e.g., BTC) that was originally purchased.
Determine the Closing Price: Identify the market price at which you will sell the asset.
Convert Proceeds: Convert the proceeds from the sale of the asset into the margin currency.
Calculate Profit or Loss: Subtract the initial cost (in margin currency) of purchasing the asset from the converted proceeds of the sale.
Initial Trade:Open Long Position: Buy Q BTC at price P USDT/BTC.
Notional Value in Quote Currency (USDT)=Q×P
Closing Trade:Sell Q BTC at the closing price Pclose USDT/BTC.
Proceeds from Sale in Quote Currency (USDT)=Q×Pclose
Convert Proceeds to Margin Currency: (Assume the conversion rate is C USDT/Margin Currency)
Proceeds in Margin Currency=CQ×Pclose
Profit/Loss Calculation in Margin Currency:
Profit/Loss=CQ×Pclose−Initial Cost in Margin Currency
- b) Closing Short Positions with Liability Calculated in Trading Currency (Different Margin Currency)
Identify the Short Position: Determine the amount of the asset (e.g., BTC) that was originally sold.
Determine the Closing Price: Identify the market price at which you will buy back the asset.
Convert Buy Back Cost: Convert the cost to buy back the asset into the margin currency.
Calculate Profit or Loss: Subtract the cost to buy back the asset (in margin currency) from the proceeds of the initial sale (converted into margin currency).
Initial Trade:Open Short Position: Sell Q BTC at price P USDT/BTC.
Proceeds from Sale in Quote Currency (USDT)=Q×P
Convert Proceeds to Margin Currency: (Assume the conversion rate is C USDT/Margin Currency)
Proceeds in Margin Currency=CQ×P
Closing Trade:Buy back Q BTC at the closing price Pclose USDT/BTC.
Cost to Buy Back in Quote Currency (USDT)=Q×Pclose
Convert Buy Back Cost to Margin Currency:
Cost to Buy Back in Margin Currency=CQ×Pclose
Profit/Loss Calculation in Margin Currency: Profit/Loss=CQ×P−CQ×Pclose
Example:
Initial Trade (Short Position): Sell 1 BTC at 30,000 USDT.
Convert Proceeds: Assuming the conversion rate is 1 USDT = 0.001 BTC.
Proceeds in BTC=100030,000USDT=30BTC
Closing Trade: Buy back 1 BTC at 25,000 USDT.
Convert Buy Back Cost:
Cost to Buy Back in BTC=100025,000USDT=25BTC
Profit Calculation:
Profit=30BTC−25BTC=5BTC
Closing Long Positions: Sell the asset, convert proceeds to margin currency, and calculate profit/loss based on the difference between the converted proceeds and the initial cost in margin currency.
Closing Short Positions: Buy back the asset, convert the buyback cost to margin currency, and calculate profit/loss based on the difference between the proceeds from the initial sale (converted) and the converted buyback cost.
Closing at Limit Price
Closing a position at a limit price means placing an order to close an open position at a specific price.
The position will be closed when all position assets are sold at limit price.
Rules
Set the Limit Price: Decide the price at which you want to close the position.
Place the Limit Order: Enter a limit order specifying the amount of the asset to be closed and the limit price.
Wait for Execution: The order will remain open until the market price reaches the limit price or better. If the market never reaches this price, the order may not be executed.
Monitor the Order: Regularly check the order status to ensure it is executed. Adjust the limit price if market conditions change.
- a) Closing Long Positions at Limit Price
Rules:
Determine the Limit Price: Set the limit price at which you want to sell the asset.
Calculate Potential Proceeds: Calculate the proceeds from selling the asset at the limit price.
Calculate Potential Profit/Loss: Determine the profit or loss based on the difference between the initial purchase price and the limit price.
Initial Trade:Buy Q units of the asset at initial price Pinitial.
Initial Cost=Q×Pinitial
Limit Order to Close Position:Sell Q units of the asset at limit price Plimit.
Proceeds from Sale=Q×Plimit
Potential Profit/Loss:Potential Profit/Loss=Q×(Plimit−Pinitial)
- b) Closing Short Positions at Limit Price
Rules:
Determine the Limit Price: Set the limit price at which you want to buy back the asset.
Calculate Potential Cost: Calculate the cost of buying back the asset at the limit price.
Calculate Potential Profit/Loss: Determine the profit or loss based on the difference between the initial selling price and the limit price.
Initial Trade:Sell Q units of the asset at initial price Pinitial.
Proceeds from Initial Sale=Q×Pinitial
Limit Order to Close Position:Buy back Q units of the asset at limit price Plimit.
Cost to Buy Back=Q×Plimit
Potential Profit/Loss: Potential Profit/Loss=Q×(Pinitial−Plimit)Example
Closing a Long Position
Initial Trade:Buy 1 BTC at $30,000.
Initial Cost=1×30,000=30,000USDT
Limit Order to Close Position:Sell 1 BTC at $35,000.
Proceeds from Sale=1×35,000=35,000USDT
Potential Profit:Potential Profit=1×(35,000−30,000)=5,000USDT
Closing a Short Position
Initial Trade:Sell 1 BTC at $30,000.
Proceeds from Initial Sale=1×30,000=30,000USDT
Limit Order to Close Position:Buy back 1 BTC at $25,000.
Cost to Buy Back=1×25,000=25,000USDT
Potential Profit:Potential Profit=1×(30,000−25,000)=5,000USDT
Closing Long Positions at Limit Price: Set a limit price to sell the asset, calculate potential proceeds and profit/loss based on the difference between the limit price and the initial purchase price.
Closing Short Positions at Limit Price: Set a limit price to buy back the asset, calculate potential cost and profit/loss based on the difference between the initial selling price and the limit price.