币安合约websocket接口查询持仓账户范例
8
Follow
1361
Followers
币安合约websocket接口查询持仓账户范例
币安文档:https://binance-docs.github.io/apidocs/delivery/cn/#e3ee8329c9
测试时添加配置之后的币安期货交易所对象。
Source
JavaScript
function main() {
LogReset(1)
var ws = null
exchange.IO("base", "https://dapi.binance.com")
var obj = exchange.IO("api", "POST", "/dapi/v1/listenKey")
Log(obj, typeof(obj))
var listenKey = obj.listenKey
Log("listenKey:", listenKey)
var ts = new Date().getTime()
ws = Dial("wss://dstream.binance.com/ws/" + String(listenKey))
while (1) {
var arr = ["balance", "account", "position"]Related strategies
Comment
All comments (13)
您好,需要订阅对应频道才会有推送的数据,具体可以看下交易所文档上如何订阅,例子里只订阅了这些:var arr = ["balance", "account", "position"]
4 years ago
- 1







