> For the complete documentation index, see [llms.txt](https://docs.metacopier.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metacopier.io/features/pro-features/margin-cap.md).

# Margin Cap

{% hint style="info" %}
This feature can be added at the copier level. It is especially useful for prop firm traders who must comply with strict margin usage rules.
{% endhint %}

The **Margin Cap** feature allows you to set a maximum percentage of your account balance that can be used as margin across all open positions. When a new trade signal arrives, MetaCopier automatically calculates the maximum lot size that can be opened without exceeding the configured margin cap, taking into account existing open positions.

This eliminates the need to manually recalculate your maximum lot size after every trade.

## How It Works

When a new trade is about to be copied, the system calculates:

```
Remaining margin = (Margin Cap % × Account Balance) − Used Margin
Max lots = (Remaining margin × Leverage) / (Symbol Price × Contract Size)
```

{% hint style="info" %}
**Leverage detection.** The leverage used in the calculation is automatically detected per symbol. Many brokers apply a lower leverage to specific instruments (for example XAUUSD at 1:30 on a 1:100 account). MetaCopier reads this per-symbol leverage directly from the trading platform and uses it instead of the account leverage when available. If your broker does not expose the per-symbol leverage, you can force the correct value using the **Leverage** field described below.
{% endhint %}

### Example

For a **$100,000** account with **1:30 leverage** and a **20% margin cap**, trading **XAUUSD** at **$4,541.20** (contract size = 100):

1. **Maximum usable margin**: 0.20 × $100,000 = **$20,000**
2. **Effective buying power**: $20,000 × 30 = **$600,000**
3. **Notional value per lot**: $4,541.20 × 100 = **$454,120**
4. **Max lot size**: $600,000 ÷ $454,120 ≈ **1.32 lots**

If existing trades are already using $12,000 in margin (12%):

1. **Remaining margin**: $20,000 − $12,000 = **$8,000**
2. **Max lot size for new trade**: ($8,000 × 30) ÷ $454,120 ≈ **0.53 lots**

## Configuration

<figure><img src="/files/i9vzsl5HPHBX0rIJKApY" alt=""><figcaption><p>Margin cap configuration</p></figcaption></figure>

* **Margin cap percentage**: The maximum percentage of account balance that may be used as margin. A value of `0` disables the feature.
* **Behavior when cap is reached**:
  * **Reduce lot size** (default): Automatically calculates the maximum lot size that fits within the remaining available margin and opens the trade at a reduced size.
  * **Skip trade**: Rejects / skips the trade entirely if it would cause the margin cap to be exceeded.
* **Scope**:
  * **Cumulative** (default): The margin cap applies to the sum of all open positions. For example, all trades together must not exceed 20% margin usage. This is the most common prop firm rule.
  * **Per trade**: Each individual trade must not exceed the specified margin percentage on its own, regardless of other open positions.
* **Per-symbol configuration**: Optionally define different margin caps per symbol or asset class. Symbol-specific rules always take priority over the global setting. This is useful for prop firms that enforce margin caps per asset class (e.g., 20% for Forex, 10% for Indices).
* **Leverage** (optional override):
  * **Empty or `0`** (default): Auto-detect. MetaCopier uses the broker per-symbol leverage when reported (e.g. XAUUSD 1:30 on a 1:100 account), and falls back to the account leverage otherwise.
  * **Greater than `0`**: Force this leverage value (e.g. `30` for 1:30) regardless of what the broker reports. Useful when the broker does not expose per-symbol leverage for metals/CFDs and the auto-detection ends up using the wrong (account-wide) value. The override can also be set per symbol via the per-symbol configuration above.

{% hint style="info" %}
If both Margin Cap and other lot-sizing features (Max Lot Size, Risk Per Trade, Multiplier) are active, the most restrictive limit applies. The Margin Cap acts as a final safety net after other lot size calculations.
{% endhint %}

## Use Cases

**Prop Firm Compliance**

Many prop firms enforce strict margin usage rules such as:

* "Maximum 20% margin used across all open trades"
* "Maximum 20% margin used per asset class"
* "Maximum 10% margin per individual trade"

The Margin Cap feature ensures MetaCopier automatically respects these limits without requiring manual intervention.

**General Risk Management**

Even outside of prop firms, the Margin Cap provides an additional safety layer by preventing over-leveraging due to accumulated copied trades.
