Server pluginRisk managementv1.2.09 options Live demo

Real Margin Stopout

Closes the positions of a client whose own money is gone, so nobody keeps trading on credit alone.

Get a licenseDownload

What it does

7 capabilities
  • Exact 128-bit stop out on own funds: equity minus credit, divided by margin
  • Fixed stop_level or per-group stop out threshold (use_group_stop_out)
  • Close all positions or close largest-loss position one by one
  • Optional filter to act only on accounts carrying bonus credit
  • Cancels pending orders before liquidation and retries failed closes
  • Optional credit removal once flat, persisted safely across restarts
  • Optional client mail, risk team alert, and stopouts report

How it works

Credit and bonus lift the equity and margin level of an account, so the native MT5 stop out fires late. This plugin checks the client's own funds (equity minus positive credit) against margin using exact 128-bit arithmetic. When the own-funds margin level falls to or below stop_level (or the group's stop out level when use_group_stop_out is enabled), it cancels pending orders if configured and closes either all positions or the single largest-loss position until the account recovers or is flat. Tagged close actions with timeout retries prevent deadlocks on transient errors. Once flat, it can remove the bonus credit, notify the client by MT5 mail, alert the risk team, and write every stop out to a report. Use StopOut Notifier with exclude_credit=1 to warn clients before liquidation.

Parameters & options

Configured directly in MetaTrader 5 Administrator and testable live in the simulator.

12 of 12
ParameterTypeDefaultDescription
groups
group mask*Client groups that are watched (MT5 group mask). * means all
stop_level
number50.00Own-funds margin level in percent at or below which positions are closed
remove_credit
bool01: remove the credit after the positions are closed
only_with_credit
bool01: only act on accounts that currently have positive credit
use_group_stop_out
bool01: use the account group's stop out level (when above 0) instead of stop_level
close_mode
textallHow to liquidate on stop out: all (close all positions) or largest_loss (close the worst losing position first)
cancel_pending_orders
bool11: cancel pending orders on the account when triggering stop out
notify_client
bool11: send an MT5 mail message to the client when stop out triggers
notify_risk
bool11: raise a risk alert when stop out triggers
license_key
System
textemptyLicense key from FXOpsPro, for example FXO-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
license_server
System
texthttps://plugins.fxopspro.comLicense server address
dealer_login
System
int0Manager login with dealer rights that closes or opens positions for the plugin. 0: the plugin only logs

Release history

  1. v1.2.0Latest2026-11-24

    Fixed exact 128-bit margin comparison, negative credit clamping, mark_dirty persistence, and tagged close retries with timeout pruning. Added only_with_credit, use_group_stop_out, close_mode (all/largest_loss), cancel_pending_orders, notify_client, and notify_risk.

  2. v1.1.02026-11-22

    Removed the warn_level parameter and the warning message. The StopOut Notifier plugin sends warnings now. The stop out and remove_credit do not change.

Risk management

View all server plugins