@Lee2011
2020-06-12T12:12:01.000000Z
字数 2473
阅读 1672
MT4
API
MT4 是一款市场行情接收与交易软件,MT4是MetaQuotes Software Corp4 缩写,由迈达克软件公司发布。它适用于外汇, CFD以及期货市场。
MT4分为服务器与客户端,而客户端又分为普通用户端和 Manager 管理端。
本接口主要是封装 Manager 管理端提供的 API 接口(dll库),以服务的形式运行在 Windows 平台,并对外提供方便调用的 HTTP 请求形式的调用入口,实现诸如新增账户,修改账户,同步账户信息,出入金,同步账户交易订单信息等接口。
http://127.0.0.1:15000/IsConnected
心跳成功: {"retcode":0,"msg":"IsConnected"}
心跳失败: {"retcode":1,"msg":"NOT Connected"}
http://127.0.0.1:15000/Disconnect
断开连接成功: {"retcode":0,"msg":"Disconnect Success"}
断开连接失败: {"retcode":1,"msg":"Disconnect Failed"}
http://127.0.0.1:PORT/Connect?ip=47.52.230.9&port=443
http://127.0.0.1:PORT/Login?login=6008&passwd=XXXX
http://127.0.0.1:15000/Ping
心跳成功: {"retcode":0,"msg":"Ping Success"}
心跳失败: {"retcode":1,"msg":"Ping Failed"}
login 指定账户,为 UserRecordsRequest
login = 0时列举全部账户 UsersRequest
http://127.0.0.1:PORT/UsersRequest?login=733256
http://127.0.0.1:PORT/GroupsRequest
http://127.0.0.1:PORT/UsersGroupOp?login=733256&optype=DISABLE&newgroup=manager&newleverage=200
optype=DISABLE 禁用
optype=ENABLE 启用
optype=DELETE 删除
newgroup 新组名必须包含在通过GroupsRequest接口获得的全部可用组名内
http://127.0.0.1:PORT/UserRecordNew?login=next&passwd=weqw123q&group=ComPro-USD&name=111111&email=234143234@qq.com
不能用manager组,login 为指定的login号码,如果不知道建议为 0 或next
http://127.0.0.1:PORT/UserRecordUpdate?login=XXXXXX&$$$$$$=#######
需指定需要修改用户属性的login(XXXXXX)、该属性名称($$)和该属性的值(######)
这里的属性名称和属性值的组合可以是多组
http://127.0.0.1:PORT/TradesUserHistory?login=733256&from=917144243&to=1548296243
用户交易记录 需指定login和查询的开始时间时间戳(from)、结束时间的时间戳(to)
http://127.0.0.1:PORT/SymbolsGetAll
http://127.0.0.1:PORT/UserPasswordSet?login=XXXXXX&passwd=#######
需要指定需要修改密码的login(XXXXXX)和该账户的新密码(######)
http://127.0.0.1:15000/ManagerRights
正确返回:{"retcode":0,"msg":"ManagerRights Success","data":{"admin":"1","broker":"1","email":"0","logs":"1","manager":"1","market":"0","market_watch":"1","money":"1","news":"0","notifications":"0","online":"1","plugins":"0","reports":"1","riskman":"1","see_trades":"1","server_reports":"0","techsupport":"0","trades":"1","user_details":"1"}}
http://127.0.0.1:15000/TradeTransaction?login=507980&amount=11.00&comment=测试
成功返回 {"retcode":0,"msg":"TradeTransaction Success"}
http://127.0.0.1:15000/RequestCommon
正确返回:{"retcode":0,"msg":"RequestCommon Success","data":"GMT+02:00"}