首先前往github下载
https://github.com/mikha-dev/mt4-websockets
项目
把里面的项目复制到mt4软件目录里。
操作如下:
点开文件->打开数据文件夹
复制进去。
记得点击工具->选项
勾选这些选项。
我们会在
mt4里看到websockets这个文件,右键修改
#property version "1.00"
#property strict
#include <lib_websockets.mqh>
input string Host = "http://xxx.xxx.xxx:8080";//这里是websocket服务器地址
input int HeatBeatPeriod = 45;
int commandPingMilliseconds = 1000;//这里是1秒发送一次
WebSocketsProcessor *ws;
int OnInit() {
ws =<