MQL4参考 MQL5 特色 MQL5 functions Network Functions

Network functions

MQL5 programs can exchange data with remote servers, as well as send push notifications, emails and data via FTP.

Add an explicit message to the MQL5 program to notify a user of the need for additional configuration. You can do that via #property description, Alert or Print.

Function

Action

SocketCreate

Create a socket with specified flags and return its handle

SocketClose

Close a socket

SocketConnect

Connect to the server with timeout control

SocketIsConnected

Checks if the socket is currently connected

SocketIsReadable

Get a number of bytes that can be read from a socket

SocketIsWritable

Check whether data can be written to a socket at the current time

SocketTimeouts

Set timeouts for receiving and sending data for a socket system object

SocketRead

Read data from a socket

SocketSend

Write data to a socket

SocketTlsHandshake

Initiate secure TLS (SSL) connection to a specified host via TLS Handshake protocol

SocketTlsCertificate

Get data on the certificate used to secure network connection

SocketTlsRead

Read data from secure TLS connection

SocketTlsReadAvailable

Read all available data from secure TLS connection

SocketTlsSend

Send data via secure TLS connection

WebRequest

Send an HTTP request to a specified server

SendFTP

Send a file to an address specified on the FTP tab

SendMail

Send an email to an address specified in the Email tab of the options window

SendNotification

Send push notifications to mobile terminals whose MetaQuotes IDs are specified in the Notifications tab