Overview
The MT5 integration allows you to push trading data from MetaTrader 5 to the API. This includes account information, open positions, and closed trade history.Prerequisites
- An MT5 account number
- Access to MT5 Expert Advisor (EA) or script development
Update account data
Push account balance and margin information:Update open orders
Push current open positions:Update trade history
Push closed positions:MQL5 example
Here’s a basic MQL5 script to send account data:Remember to add
https://api-verifier-2.onrender.com to the allowed URLs in MT5: Tools → Options → Expert Advisors → Allow WebRequest for listed URL.Best practices
- Update frequency - Send account updates every 1-5 minutes, not on every tick
- Error handling - Implement retry logic for failed requests
- Batch updates - Send all open orders in a single request rather than individually
- Timestamps - Always include ISO 8601 formatted timestamps