> For the complete documentation index, see [llms.txt](https://mdexdoc.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mdexdoc.gitbook.io/doc/yong-hu-zhi-nan/futures-trading/how-to-use-the-mdex-futures-calculator.md).

# How to use the MDEX Futures Calculator

You can use the MDEX Futures Calculator to calculate your Initial Margin, PnL, and ROE for each order.

1\. Click the \[**Calculator**] icon as shown below.

<figure><img src="/files/KTi7QoQB3U9vSEegUZyb" alt=""><figcaption></figcaption></figure>

2.You can use the Calculator to calculate your PnL, Target Price, or Liquidation Price.

<figure><img src="/files/NlesUQAfav8FgiOiLsC1" alt=""><figcaption></figcaption></figure>

3\. After choosing an option, select **\[Long]** or **\[Short]**, then enter the Entry Price, Exit Price, and Quantity. You can also adjust the leverage multiplier here. Fill in the order details, then click **\[Calculate]**. ApolloX will then automatically calculate your Initial Margin, PnL, and ROE.

&#x20;

**USDⓈ-M Perpetual Futures**

Initial Margin = Quantity \* Entry Price \* Initial Margin Rate(IMR)

Initial Margin Rate (IMR) = 1 / leverage Multiplier

Calculation for PnL:

Long = (Exit Price - Entry Price) \* Number of Contracts

Short = (Entry Price - Exit Price) \* Number of Contracts

ROE% = PnL / Initial Margin = Order Direction \* (1 - Entry Price / Exit Price) / Initial Margin Rate
