Type/to search

Notification des changements de position Bitmex vers WeChat (protocole wss, nécessite l'ID API Bitmex)

Study
3
Follow
1508
Followers

Utilisez le protocole WebSocket et la méthode la plus récente de la plateforme pour obtenir la signature HMAC. Lorsque la position change, elle est poussée vers WeChat.

Source
JavaScript
function main() {
    var APIKEY = "your Access Key(Bitmex API ID)"
    var expires = parseInt(Date.now() / 1000) + 10
    var signature = exchange.HMAC("sha256", "hex", "GET/realtime" + expires, "{{secretkey}}")//secretkey在执行时自动替换,不用填写
    var client = Dial("wss://www.bitmex.com/realtime", 60)
    var auth = JSON.stringify({args: [APIKEY, expires, signature], op: "authKeyExpires"})
    var pos = 0
    client.write(auth)
Comment
All comments (2)

    这个需要传入API的私钥吗?会不会不安全?

    8 years ago

    不需要,看策略代码

    8 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)