Monitor
This EA is a multi-terminal price monitor that uses memory-mapped files (shared memory via DLL) to exchange bid prices between multiple MetaTrader 5 instances running on the same machine. It continuously writes its own terminal's bid price to shared memory and reads bid prices from other connected terminals, displaying horizontal price lines on the chart for comparison. It does not open any trades and serves purely as a monitoring and price comparison utility.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
This EA is not a trading strategy EA but rather a cross-terminal price monitoring tool based on shared memory. Its core concept leverages Windows memory-mapped file mechanisms to share real-time quote data between multiple MT5 terminals running on the same machine. Each terminal instance opens or creates a shared memory file during initialization, registers itself as a user, and allocates a data slot for writing. In the infinite loop within OnTick, each instance continuously writes the current Bid price, account login, timestamp, and terminal name to its own slot while reading data from all other slots. If a terminal's data timestamp exceeds the MaxLate delay threshold, that terminal is considered inactive and its price line is not displayed. Entry and exit conditions are not applicable since this EA does not perform any trading operations. Position sizing and money management are also not applicable. The tool's primary value is enabling traders to simultaneously monitor quote differences across multiple terminals or brokers, facilitating arbitrage opportunity detection or connection status monitoring.
Strengths
- Uses shared memory for efficient inter-process communication with minimal latency, ideal for real-time monitoring
- Supports both 32-bit and 64-bit terminals with automatic architecture detection via _IsX64, ensuring broad compatibility
- Supports dynamic terminal connection and disconnection with a header counter managing user count; last terminal automatically closes shared memory
- Visually displays each terminal's quote as a horizontal line on the chart, enabling quick identification of price discrepancies and arbitrage opportunities
Weaknesses
- Depends on external DLLs (MemMap32.dll/MemMap64.dll) which cannot run in environments that disable DLL loading and introduce security risks
- Uses an infinite while loop with Sleep in OnTick, blocking normal event processing and potentially causing terminal slowdown or conflicts with other EAs
- Lacks robust error recovery; when shared memory read/write fails, it only prints logs without attempting to reconnect or rebuild the shared memory
- No data validation or encryption on shared memory content, making it vulnerable to data tampering by malicious processes
Possible improvements
- Replace the infinite while loop with Timer event or OnBookEvent driven mode to avoid blocking the EA event queue and improve overall terminal responsiveness
- Add self-checking and automatic reconnection for shared memory; attempt to reinitialize when shared memory is detected as invalid
- Implement data validation mechanisms (e.g., CRC checksum or simple magic number) to prevent shared memory data from being tampered with or corrupted
Risk assessment
Overall risk: Safe
- Dependency on external DLLs may introduce security vulnerabilities or cause system instability
- Infinite loop blocking OnTick may affect the normal operation of other EAs in the same terminal
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MaxLate | 5000 | Maximum latency in ms; terminal data not updated beyond this is inactive |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.