1

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!

Marci Banez
  • 115
  • 1
  • 9
  • 1
    FYI I believe I have solved this on this: https://stackoverflow.com/questions/52608482/bitmex-api-php-cancel-one-order-doesnt-work/56573295#56573295 – Julian Jun 13 '19 at 04:20
  • thanks for answering! seems a promising solution! will try it soon :) – Marci Banez Jun 14 '19 at 05:05

0 Answers0