Skip to content
All library documents

Using WinInet to Exchange Data Between MQL Trading Terminals

Article MQL5 articles

Summary

This tutorial describes a reusable MQL class for HTTP communication through WinInet. It outlines the lifecycle of a network session and connection, sending requests, reading server responses, and closing handles. The examples cover retrieving page contents into a string or file, and sending additional data or file contents with a request. The intended applications include sharing information between terminals, fetching data for Expert Advisors, distributing signals, and managing or updating trading programs remotely.

The implementation emphasizes creating a session once and reusing it rather than repeatedly opening connections, checking that terminal DLL use is allowed, and releasing every WinInet handle. Its examples focus mainly on GET-style requests; POST requests and file sharing are deferred to a later article. This is infrastructure guidance rather than a trading method, and it does not present tests, reliability measurements, or security analysis. Actual use depends on DLL permissions, server configuration, and correctly handling network and file errors.

Key ideas

  • A reusable MQL class can manage WinInet sessions, HTTP requests, responses, and handles.
  • The tutorial reads server responses into either a string or a local file.
  • Session and connection objects should be reused during program operation and closed when finished.
  • The examples focus on GET requests, while POST transfer scenarios are left for later coverage.
  • The document provides connectivity plumbing rather than evidence of trading performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.