Skip to content
All library documents

Testing MT5 Expert Advisor Entry-State Rules with Synthetic Cases

Article MQL5 code base

Summary

This document describes a small MT5 acceptance harness for checking an Expert Advisor’s entry-state logic against deterministic synthetic cases. Its eight fixtures cover a valid closed-bar entry, duplicate signal bar, open-bar rejection, cooldown handling, missing signal, daily lock, and reset on a new day. For each case, the script reports the expected decision alongside the actual decision and summarizes the pass/fail count.

The harness is a way to check whether specified state transitions behave as intended, rather than a trading strategy or market test. Optional settings control whether a report is written to the terminal’s common files folder and whether results are printed in the Experts log. The document says the source compiled without errors or warnings, but does not provide runtime output; users are directed to inspect the report from their own terminal. Because the fixtures are synthetic and the script does not access market or account data or place orders, passing the cases cannot establish strategy quality, profitability, broker execution, or live-account behavior.

Key ideas

  • The harness checks entry-state decisions using deterministic synthetic fixtures.
  • Its cases include bar validation, duplicate signals, cooldowns, daily locks, and a new-day reset.
  • Reports compare expected and actual decisions and show a pass/fail count.
  • The script can optionally write a file or print results in the Experts log.
  • Synthetic state checks do not demonstrate profitability or live trading behavior.

Tags

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