Skip to content
All library documents

Centralizing Account-Wide Risk Across Multiple Trading Systems

Article MQL5 articles

Summary

This article proposes an account-level risk service for MetaTrader 5 accounts running multiple Expert Advisors. When each EA sizes trades and enforces loss limits independently, their combined positions can create concentrated currency exposure, correlated losses, or breaches of an account-wide daily limit even if each system follows its own rules. The proposed design separates signal generation from portfolio risk decisions: each EA submits a trade intent, and a central service decides whether to approve it and what size to allow.

The service, called RiskGate, is described as a client-server architecture using TCP and JSON. An EA sends details such as symbol, direction, and stop loss; a handler checks rules and returns an approval status, lot size, and reason. The article outlines possible controls including daily loss caps, exposure limits, correlation constraints, position counts, and strategy budgets. It also discusses connection timeouts and fallback behavior, recommending rejection as a default for some account types. The piece presents an architecture and implementation skeleton rather than measured performance evidence; the effectiveness depends on correctly defining and enforcing the risk rules.

Key ideas

  • Multiple EAs can create account-level risks that isolated backtests and local limits fail to capture.
  • The architecture assigns signal generation to each EA and account-wide risk decisions to a central service.
  • A trade request can receive approval or rejection, an allowed position size, and an explanatory reason.
  • The central handler can enforce daily loss, symbol exposure, correlation, and strategy-level constraints.
  • Connection failures require an explicit fallback policy, and the article recommends rejecting trades as a conservative default.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.