거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Working with sockets in MQL5 - MetaTrader 5용 라이브러리

조회수:
16762
평가:
(52)
게시됨:
2010.08.16 17:05
업데이트됨:
2016.11.22 07:32
socket.zip (506.46 KB)
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This example will show you how to implement the realtime ticks transfer from MetaTrader 5 client terminal to external server application.

The TCP protocol is used, it allows to transfer the data not only locally, but globally all over the Internet.

The Winsock2 library (ws2_32.dll) is used for working with sockets. The direct calls of the library functions is impossible, because MQL5 doesnt allow to work with pointers and pass complex data structures as parameters of DLL functions. The library socket_mql5.dll, written in C++, is an intermediate wrapper, connecting the Expert Advisor and sockets library.

The interaction of MetaTrader 5 with external server application is presented at Fig. 1:

Scheme of the interaction with MetaTrader 5 client terminal

Figure 1. Interaction of MetaTrader 5 with external server application

The minimal set of the functions for one-way transfer (SocketOpen, SocketWrite, SocketClose) is implemented in socket_mql5.dll library.

An example of an Expert Advisor, connected to server and used to transfer the realtime tick data to external server application is presented at figure 2.

Data transfer from MetaTrader 5 to server application

Figure 2. Export tick data from MetaTrader 5 client terminal to external server application

The archive contains:

  • An Expert Advisor
  • The socket_mql5.dll library (C++ source code is written in Visual Studio 2008)
  • The TCP server and TCP client (Delphi7 sources)

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/169

i-ImpulseSystem i-ImpulseSystem

The indicator is based on the Elder's Impluse system.

An Expert Advisor, based on Bollinger Bands ® An Expert Advisor, based on Bollinger Bands ®

This Expert Advisor is based on Bollinger Bands. It uses trend-following strategy and Bollinger Bands indicator.

AlfOs AlfOs

It's an oscillator, similar to OsMA with Variable Index Dynamic Average.

Keywords and aliases of MQL5 Keywords and aliases of MQL5

The MQL5 keywords and aliases for autoreplace are presented.