Coordinating Trade Pauses Across Multiple MetaTrader Experts
Summary
This article presents a way to enforce a minimum delay between trade operations made by multiple Expert Advisors running in one MetaTrader terminal. A local timestamp works when only one expert is active, but separate experts cannot see one another’s state. The proposed function instead stores the last trade time in a terminal-wide global variable, checks the elapsed time before proceeding, and waits in short intervals while reporting the remaining delay. It also checks whether the expert has been stopped and handles global-variable errors.
A diagnostic example shows two experts sharing the pause, while a later integration example combines the timing check with a trade-context lock to reduce conflicts when several experts access the shared state. The function bypasses waiting in strategy testing. The article demonstrates coordination rather than trading performance, and its example pause duration is illustrative. The shared timestamp coordinates operations only among experts using the same variable and terminal; it does not establish broker-wide throttling across separate terminals.
Key ideas
- A local timestamp can regulate trade spacing for one expert, but cannot coordinate separate experts.
- A terminal global variable lets multiple experts share the most recent trade time.
- The pause function checks elapsed time, waits while needed, reports remaining time, and exits if stopped.
- A trade-context lock is used alongside the shared timestamp to manage concurrent access.
- The examples demonstrate timing coordination, not evidence of a profitable strategy.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.