Skip to content

Margin requirements

The Margin requirements module prevents opening new orders based on your available margin, to protect your account to some degree from margin calls. We advise all live traders to use this module with defensive settings.

Free margin Used margin 100% No orders 90% Order 1 80% Order 2 70% Order 3 75% Minimum free margin (%) = 75 1 Order 1 90% Free margin 2 Order 2 80% Free margin 3 Order 3: blocked 70%, below the minimum
Margin requirements
  1. Before an order opens, the module calculates the margin the order needs.
  2. If the free margin would drop below Minimum free margin (%) after opening, or this EA would use more than Maximum ea margin (%), the order doesn’t open.
  • Name: optional, tells this module apart from others of the same kind. See Name.
  • Minimum free margin (%): the free margin (as a percentage) that must remain after opening an order. Normal value: 0 to 100; 0 = no limit. With 100 no order opens, because the free margin would drop below 100%.
  • Maximum ea margin (%): the margin (as a percentage) this EA may use. Useful when you run several EAs on one account and want margin to remain for this EA. Normal value: 0 to 100; 0 = no limit. If your EA uses 10% of margin per order, set it to at least 10, otherwise the EA can’t open an order.

You run ‘EA 1’ and ‘EA 2’. Both use 10% of margin per order. You never want less than 60% free margin, and ‘EA 1’, your best EA, must always be able to open at least 1 order.

  • Set Minimum free margin (%) to 60 on both EAs.
  • Set Maximum ea margin (%) to 40 for ‘EA 1’ and 30 for ‘EA 2’.

‘EA 2’ can open 3 orders, and 10% of margin remains for ‘EA 1’ to open 1 order.

The percentages in these settings are not the Margin Level percentage of MetaTrader.

Example: your account has 10,021 USD, so 100% free margin. An order of 0.05 BTC uses 743 USD of margin: about 7.4%. Your free margin is now 92.6%.

  • With Maximum ea margin (%) at 7.4, or Minimum free margin (%) at 92.6, the EA can’t open a second order: the next one would use another 7.4% (14.8% in total).
  • With a maximum of 5 from the start, the first order wouldn’t have opened either: the required margin is calculated before an order opens.

To stay above a Margin Level of 400%:

  • Minimum free margin (%) = 100 − 100 × (100 / Margin Level)
  • Minimum free margin (%) = 100 − 100 × (100 / 400) = 75

Alternatively, let the EA use only 25% of your margin: Maximum ea margin (%) = 25.

MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.