EA turns your MT5 terminal into historical/realtime rates data provider for your application.
There are many market data providers on the internet, but in practice, the data provided is not always of good quality. Moreover, these services are often more expensive and typically require monthly subscription fees per each symbol.
With this EA, you can feed your application with exactly the same rates data that you see in the MT5 terminal, the same data on which you base your trades and market analysis.
Together with the EA that provides ticks data, a complete data set necessary for market analysis is offered.
Input | Description | Default |
---|---|---|
dataProvider | Specifies the name of data provider. This name can then be used in URL templates as {dataProvider}. | - |
maxRatesPerBatch | Maximum number of rates that can be semt in a single batch. | 10000 rates |
debugLogsEnabled | Whether to enable debug logs. | true |
targetExportUrlTemplate | URL template for endpoint where the rates data will be sent. Supported placeholders: dataProvider. | - |
shouldReExportHistoricalRates | Option to re-export rates starting from a specific value, as specified in the startExportFromTimestampMillis input. | false |
startExportFromTimestampMillis | If shouldReExportHistoricalRates is set to true, rates will be sent starting from the timestamp specified in milliseconds. | 1672531200000 (2023-01-01 0:00:00) |
exportedSymbolsSource | Source for the symbols for which rates will be exported. Options are: 'HTTP_ENDPOINT' or 'EA_INPUT'. | EA_INPUT |
symbols | In cases where exportedSymbolsSource is set to 'EA_INPUT', this setting specifies which symbols rates will be exported. | EURUSD |
timeframes | Specifies the timeframes for the rates to be exported when exportedSymbolsSource is set to 'EA_INPUT'. | M1,M5,M15,M30,H1,H4,D1,W1 |
exportedSymbolsFetchUrlTemplate | URL template to fetch the rates symbols. Used in case exportedSymbolsSource='HTTP_ENDPOINT'. Supported variables: dataProvider. | - |
lastSentRateTimestampSource | Source for the timestamp of the last sent rate. Options are: 'HTTP_ENDPOINT' or 'FILES'. | FILES |
lastSentRateTimestampUrlTemplate | URL template to fetch the timestamp of the last sent rate. Used in case exportedSymbolsSource='HTTP_ENDPOINT'. Supported placeholders: dataProvider, symbol, timeframe. | - |
Upon initialization, the Expert Advisor (EA) performs the following operations:
Reset Offset Check: The EA checks the shouldReExportHistoricalRates variable to determine if there's a need to export historical rates data from a specific timestamp. If a re-export is required, it:
Periodic Rates Data Harvesting and Sending: The EA is programmed with a timer set to activate at intervals defined by dataSendingIntervalMilliseconds. Upon each activation, the EA:
By executing these steps, the EA ensures a continuous and automated stream of the most recent rates data for external use, keeping your application or analysis tools supplied with up-to-the-minute market information.
Below are the minimum actions required for the EA to start exporting rates to your configured URL
Implement an HTTP endpoint that handles a POST request on a URL derived from the targetExportUrlTemplate. This endpoint should:
Ensure that you add the host to the list of allowed hosts in 'Tools > Options > Allow WebRequest for listed URL'.
Attach the EA to any chart in MT5 and configure the following inputs:
The EA maintains the timestamp (offset) of the last successfully sent rate in order to continue the export process in the event of disruptions or a terminal restart.
By default, timestamps are stored in files that are automatically created at the following path: C:\Users{userName}\AppData\Roaming\MetaQuotes\Terminal{id}\MQL5\Files. There is a separate file for each symbol and timeframe.
Additionally, there is an option to use separate HTTP endpoints for reading/storing the offset instead of files.
To use this feature, set lastSentRateTimestampSource to 'HTTP_ENDPOINT' and implement HTTP endpoints based on the URL defined in lastSentRateTimestampUrlTemplate.
As a backend solution, you can choose to store offsets in a database (such as PostgreSQL). If you need to re-export rates for a specific symbol, you would only need to update the timestamp values in the database table.
If you set both lastSentRateTimestampSource and exportedSymbolsSource to 'HTTP_ENDPOINT', then the EA can be fully controlled externally:
HTTP Endpoint | Description | Method | Request | Response |
---|---|---|---|---|
targetExportUrlTemplate | URL for sending rates data. | POST | Headers: Content-Type: application/json Body [ { "symbol": "EURUSD", "timeframe": "H1", "timestampMillis": 1670001234567, "open": 1.12345, "high": 1.12500, "low": 1.12200, "close": 1.12400, "tickVolume": 123456, "spread": 0.0002, "realVolume": 1000000 }, ... ] | Response Code 200 in case rates are obtained successfully |
exportedSymbolsFetchUrlTemplate | URL is used to retrieve the list of rates symbols that the EA will export to the URL derived from 'targetExportUrlTemplate'. | GET | Headers: Content-Type: text/plain Body (coma separated list of symbols) EURUSD,GBPUSD,AUDUSD,BTCUSD | |
lastSentRatesTimestampUrlTemplate | URL is utilized to fetch the specific timestamp from which the export process should begin. | GET | Headers Content-Type: text/plain Body 1625135912000 | |
lastSentRateTimestampUrlTemplate | URL is used to store the timestamp of the last successful POST request made to the URL derived from 'targetExportUrlTemplate'. | POST | Headers: Content-Type: text/plain Body 1625135912000 |
Tags: rates, rate, price, price aggregate, stream, streaming, export, exporting, webhook, webhooks, integration, mt5, http, rest, forex, crypto, data, historical, realtime, rest api, provider, broker, data feed, ohlc
If for any reason you do not like the purchased program, you can request a refund within 30 days from the date of purchase. You can also make an exchange for any other product at an equal cost or by paying the difference.
Simply send a request for refund or exchange with your order number by email: [email protected].
Refund requests received more than 30 days after purchase will be rejected.