Skip to content
All library documents

Enforcing Symbol Whitelists for Manual and Automated Trading in MQL5

Article MQL5 articles

Summary

This article describes a MetaTrader 5 control system that restricts trading to an explicitly approved set of symbols. Its rationale is to prevent strategy drift, unintended exposure, and unreliable comparisons when traders or Expert Advisors operate on instruments outside the scope in which a strategy was researched. A whitelist makes eligibility binary: symbols on the configured list are allowed, and all others are excluded.

The proposed design uses a shared library to store, parse, and validate the list, a dashboard to configure and display authorization status, and an Expert Advisor that monitors trade transactions. It intercepts new pending orders and executed deals, cancels or closes activity on unapproved symbols, and logs blocked attempts. The article reports that tests showed allowed-symbol trading continuing while disallowed attempts were blocked. This is an implementation account rather than a broad performance study; it does not establish that the mechanism prevents every possible operational failure. Its value is as an infrastructure control for keeping a trading universe explicit and auditable.

Key ideas

  • A whitelist defines the permitted trading universe by excluding every symbol not explicitly approved.
  • The article identifies strategy drift, unintended exposure, and contaminated performance comparisons as risks of uncontrolled symbol selection.
  • A shared library, dashboard, and enforcement Expert Advisor divide configuration, visibility, and trade monitoring responsibilities.
  • The enforcer checks transactions and removes disallowed pending orders or market activity while recording blocked attempts.
  • Reported tests demonstrate the intended allow and block behavior, but do not constitute a general performance evaluation.

Tags

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