bitmex api php, cancel 1 order not working

坚强是说给别人听的谎言 提交于 2019-12-11 05:33:53

问题


I am using the Bitmex class from:

https://github.com/y0un1verse/bitmex-api-php/blob/master/BitMex.php

I dont have any issues using the functions already there. But when I tried adding my own function, it's not working properly.

the original code for CANCELLING ALL ORDERS is:

public function cancelAllOpenOrders($text = "") {
   $symbol = self::SYMBOL;
   $data['method'] = "DELETE";
   $data['function'] = "order/all";
   $data['params'] = array(
      "symbol" => $symbol,
      "text" => $text
    );
    return $this ->authQuery($data);
}

the code above works just fine, cancelling all the orders.. however I want to cancel only one order using order ID, so I made this function:

public function cancelOpenOrder($orderID) {
   $symbol = self::SYMBOL;
   $data['method'] = "DELETE";
   $data['function'] = "order";
   $data['params'] = array(
      "orderID" => $orderID
    );
    return $this ->authQuery($data);
}

However this one returns an error:

BitMex error (ValidationError) : orderIDs or clOrdIDs must be sent. false

Even if I added the orderID or clOrdID, it is not sent properly. Anyone could point me to the right direction? Thanks in advance!

来源:https://stackoverflow.com/questions/50013678/bitmex-api-php-cancel-1-order-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!