Easy websocket library for mql5
An easy to use websocket library for MQL5. It supports:
- ws:// and wss:// (secure websocket)
- text and binary data
- automatic ping-pong handling on protocol level
(keep-alive protocol hand shake) - automatic fragmented message handling on protocol level
(large data transfer enabled)
==================================================
ATTENTION:
PLEASE ConTACT SELLER BEFORE
PURCHASE.
Due to the nature of this kind of library,
FULL FEATURE DEMO VERSION CAN BE PROVIDED ON REQUEST
==================================================
This library requires:
Win64 OpenSSL v1.1.1d
which can be downloaded for free.
Sample code is as simple as following:
#include <wsmql.mqh> void OnStart() { // ATTENTION: library initialization must be executed first wsInit(); string url = "www.bitmex.com:443/realtime"; string msg = "{ "op": "subscribe", "args" : ["orderBookL2_25:XBTUSD"] }"; WSSHANDLE handle = wsConnect(url); int len; string resp; char recv_buffer[]; ArrayResize(recv_buffer, 65536); if(handle!=0) { Sleep(1000); char buffer[]; StringToCharArray(msg, buffer); wsSendBinary(handle, buffer, ArraySize(buffer)-1); int counter = 1; StringReserve(resp, 65536); while(!IsStopped()) { len = 65535; counter = wsReceiveBinary(handle, recv_buffer, len); if(counter >= 0) { string r = CharArrayToString(recv_buffer,0, len); PrintFormat("+++ %d: %d [%s]", counter, len, r); } Sleep(100); } PrintFormat("*** disconnect"); Sleep(1000); wsDisconnect(handle); } PrintFormat("*** DONE"); }
API provided:
- Connection:
- WSSHANDLE wsConnect(string wssURL)
- void wsDisconnect(WSSHANDLE handle)
- Text send and receive:
- int wsReceive(WSSHANDLE handle, string& buffer, int limit)
- int wsSend(WSSHANDLE handle, string buffer)
- Binary send and receive:
- int wsReceiveBinary(WSSHANDLE handle, char& buffer[], int& limit)
- int wsSendBinary(WSSHANDLE handle, char& buffer[], int limit)
- Status:
- int wsReceived(WSSHANDLE handle)
- int wsIsConnected(WSSHANDLE handle)
本店最新上架
-
- MT4 MT5跟单EA 本地跟单远程跟单 绝不
- ¥1100.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00
全网为您推荐
-
- AlgoTradeSoft
- ¥3988.00
-
- 国际期货套利软件
- ¥3988.00
-
- MT4 MT5跟单EA 本地跟单远程跟单 绝不
- ¥1100.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00
-
- 在MetaTrader市场购买MetaTrader 5的
- ¥3988.00