You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Building a Prop-Firm Rule Guard in MQL5 (Part 1): The Observation Layer.
An Expert Advisor that trades a funded or challenge account works under two rulebooks at once. The first one is its own strategy logic. The second one belongs to the proprietary trading firm, and the EA usually knows nothing about it. Break the first rulebook and you lose a trade. Break the second one and you lose the account, usually while the terminal is doing exactly what you told it to do.
MetaTrader 5 offers nothing for that second rulebook. There is no account-level constraint object, no prop-day calendar, and no notion of a challenge that started with a fixed initial balance. The daily limit resets at an hour the broker's clock does not match. The overall floor may sit still, or it may ratchet up behind the account and then freeze there for good.
In practice, the guard is written by hand and converges on a common shape: input thresholds, an OnTick() if-block, a close-all helper, and one per-protection boolean to prevent re-firing. That shape is where the interesting part of this article lives, because it fails in specific ways that stay invisible while the account is healthy.
Author: Bruno Nunes Myrrha Ribeiro