问题
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