Loading ...

关于如何在BitMEX挂仅被动成交做市单和批量下单(IO范例)

Author: 小草, Created: 2019-04-17 15:46:32, Updated: 2019-04-19 15:25:48

使用IO函数,具体参数参考BitMEX文档:https://www.fmz.com/bbs-topic/3666

做市单(仅被动成交)

var id = exchange.IO("api", "POST", "/api/v1/order", "symbol=XBTUSD&side=Buy&orderQty=1&price=5000&execInst=ParticipateDoNotInitiate")

批量挂单

var bulk = []
bulk.push({symbol:'XBTUSD', side:'Buy', orderQty:100, price:5000, execInst:'ParticipateDoNotInitiate'})
bulk.push({symbol:'XBTUSD', side:'Buy', orderQty:200, price:5100, execInst:'ParticipateDoNotInitiate'})
var param = "orders=" + JSON.stringify(bulk)
var ids = exchange.IO("api", "POST", "/api/v1/order/bulk", param)
Log(ids)

撤销所有订单

exchange.IO("api","DELETE","/api/v1/order/all","symbol=XBTUSD")

Related

More

不要香菜 HTTP请求 POST /api/futures/v3/order 请求示例 POST/api/futures/v3/order{"client_oid": “12233456”,"order_type”:”1”,"instrument_id":"BTC-USD-180213","type":"1","price":"432.11","size":"2","match_price":"0"} order_type String 否 参数填数字,0:普通委托(order type不填或填0都是普通委托) 1:只做Maker(Post only) 2:全部成交或立即取消(FOK) 3:立即成交并取消剩余(IOC)