What Are MT5 Services and Their Core Properties
Services are a distinct category of MQL5 applications that run independently of any chart, enabling the platform to receive custom price feeds or perform background maintenance tasks. Unlike Expert Advisors, indicators, or scripts, services do not require a chart to be open and are not tied to a specific symbol or timeframe. They are stored in the /MQL5/Services folder and can be launched automatically when the terminal starts, provided they were previously activated. This design allows services to operate continuously in the background, delivering real-time data from external systems or executing periodic functions without interrupting the user’s workflow.
The key differentiator is that services are not linked to charts and thus avoid the lifecycle constraints of other application types. While Expert Advisors must be attached to a chart and scripts execute once and terminate, services persist and can be managed through the Navigator window. They support the same permission settings as other apps, including trading rights, DLL imports, and signal access, but their background execution model means they do not interfere with chart-based analysis or visual testing.
Sources: MetaTrader 5 documentation: automation MetaTrader 5 documentation: robots
Launching and Managing Service Instances
To create a service instance, navigate to the Navigator window, locate the desired service under the Services folder, and select the Add service option from its context menu. This action opens a standard MQL5 program dialog where users can configure permissions, such as enabling or disabling trading access, signal settings, and input parameters. Once configured, the service instance is launched and begins running in the background. Multiple instances of the same service can be created with different parameter sets, allowing parallel execution of distinct configurations without chart conflicts.
Management of service instances is performed through the instance menu, which provides options to start, stop, or remove individual instances. The service menu in the Navigator allows users to view all running instances, stop them collectively, or access their properties. Because services are not tied to charts, they remain active even if all charts are closed, and they automatically restart when the terminal is reopened if they were previously running. This ensures continuous operation for tasks such as data feeds or system checks without manual intervention.
Sources: MetaTrader 5 documentation: automation MetaTrader 5 documentation: robots
Permissions, Security, and Configuration Controls
Services inherit the same security controls as other MQL5 applications. The Allow Auto Trading option determines whether a service can execute trading operations; if disabled globally in platform settings, no service can trade regardless of individual settings. The Allow DLL imports setting permits or restricts the use of external dynamic-link libraries, which is disabled by default for unknown sources to prevent malicious code execution. Similarly, the WebRequest function requires explicit URL whitelisting in the platform options before a service can send HTTP requests to external servers.
Additional safeguards include the ability to disable automated trading when switching accounts, profiles, symbols, or timeframes. These options prevent unintended trading during environment changes. The Allow modification of Signals setting controls whether a service can subscribe to or adjust signal parameters, which is relevant for services that aggregate or redistribute trading signals. All these controls are accessible through the service instance properties dialog or the global Expert Advisors tab in platform options, ensuring granular oversight of background operations.
Sources: MetaTrader 5 documentation: automation MetaTrader 5 documentation: robots
Practical Use Cases for Custom Price Feeds and Background Tasks
A primary use case for services is implementing custom price feeds that deliver data from external sources directly into the platform. For example, a service can poll a REST API every few seconds, parse the response, and update internal price variables or write them to a file accessible by other MQL5 programs. This mimics the behavior of broker trade servers but allows users to integrate alternative data providers, such as cryptocurrency exchanges or proprietary pricing models, without relying on broker infrastructure.
Background maintenance tasks represent another application area. Services can periodically check account equity, log trading history, archive old data, or send notifications via email or push services. Because they run independently, these tasks execute without affecting chart rendering or strategy testing. Services can also act as intermediaries, receiving data from one external system and broadcasting it to multiple Expert Advisors or indicators, enabling coordinated analysis across different symbols or strategies without direct inter-app communication.
Sources: MetaTrader 5 documentation: automation MetaTrader 5 documentation: robots
Differences from Other Application Types and Operational Limits
Services differ fundamentally from Expert Advisors, indicators, and scripts in their execution model. Expert Advisors require a chart attachment and operate within the chart’s lifecycle, while indicators are purely analytical and cannot trade. Scripts execute once and terminate, making them unsuitable for continuous tasks. Services, by contrast, are designed for long-term background operation and are not constrained by chart visibility or user interaction.
Operational limits include the fact that services cannot directly access chart objects or indicators, as they are not associated with any chart. They rely on global variables, files, or external communication methods to share data. Additionally, services do not support visual testing in the Strategy Tester, as they are not designed for historical simulation. Their performance is optimized for low-latency data handling and periodic execution rather than high-frequency trading, making them ideal for feed integration and maintenance rather than active strategy execution.
Sources: MetaTrader 5 documentation: automation MetaTrader 5 documentation: robots
AI-assisted educational article. Automated checks reviewed source support and quality; they do not guarantee accuracy. This is not investment advice. Leveraged and automated trading involves substantial risk of loss.
Sources & further reading
MetaTrader 5 documentation: automationMetaTrader 5 documentation: robotsEducational content only. This article is not investment advice. Automated and leveraged trading involves substantial risk of loss.