The method cancelOrder(BinanceOrder) is undefined for the type BinanceOrder
spapapan opened this issue · comments
Stavros Papapantelis commented
I am trying to cancel an order using the example code:
BinanceSymbol symbol = new BinanceSymbol("ETHBTC");
BinanceOrder order = api.getOrder(symbol, 123456L);
System.out.println(order.cancelOrder(order));
But I get the error:
The method cancelOrder(BinanceOrder) is undefined for the type BinanceOrder
Stavros Papapantelis commented
Also there is no method
getOrder
but
getOrderById
Web Cerebrium commented
@spapapan please use deleteOrder
instead of cancelOrder
. Seems to be a mislead in the README
Web Cerebrium commented
Also there is no method
getOrder
but
getOrderById
There is actually a method getOrder
but it accepts BinanceOrder
as the only parameter. It is used when you've just created the order and have that object from its result.
If you just have symbol and order ID, then yes, getOrderById
should be used.
Stavros Papapantelis commented
Thanks, that worked.
Also, is not
order.deleteOrder(order);
but
BinanceApi api = new BinanceApi();
api.deleterOrder(order);