Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2009.10.28 12:03

WinSock - library for MetaTrader 4

| English Español Português 日本語 Deutsch

votes: 8
WinSock.mqh (12.33 KB)view
wsockclnt.mq4 (3.78 KB)view
wsockserv.mq4 (5.28 KB)view

WinSock is a windows network interface that descented from TCP/IP Berkley Sockets, and is the default network interface for TCP/IP. The sockets lie on the session layer (OSI/5). The attached code is an operational example of windows sockets and the included library, although easily expandable, is in a basic form and not a full winsock implemenation. The advantage of the library and code presented is that it's written completely in mql4 without any use of external dll helper.

The WinSock.mqh is the library and should be placed in your include folder

The wsockserv.mq4 is a winsock echo server blocking mode example that should be put in your scripts folder

The wsockclnt.mq4 is a winsock client example that should be put in your scripts folder

Both server and client support the TCP (connection oriented) and UDP (connectionless) protocols.

To run the example attach the server to a MT4 terminal chart, and then attach the client to another chart in the same or any other MT4 terminal even in a different computer. If you use a different computer for the client take care to specify in server_addr the ip address of the computer that executes the server script. The client/server examples are adopted from the code presented here.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TypeToBytes TypeToBytes

Byte-wise operation with structures and standard data types.

PriceLines PriceLines

Script for drawing a price markup.