jaggedsoft / php-binance-api

PHP Binance API is an asynchronous PHP library for the Binance API designed to be easy to use. https://github.com/binance-exchange/php-binance-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: can't see open orders

piusidev opened this issue · comments

I have buy some MARKET and LIMIT orders, but the openOrders return is empty.

Platform:
Ubuntu 20.04

PHP Version:

  • 7.3.29

I call the openOrders endpoint but the return is empty, i have buy some orders in MARKET and LIMIT types, but i can't see this orders in openOrders.

I maked one loop for get all tickers and make one openOrder request for each ticker available, and all return empty.

PS: When i call all orders an a ticker, that work perfectly.

Code

$ticker = $_GET["ticker"];
$openorders = $api->openOrders($ticker);
echo json_encode($openorders);

Result

{
   []
}

Thanks

@piusidev Can you give an example of what $ticker contains?

@ePascalC in $ticker variable only have a string with the ticker, example: BNBUSDT

@piusidev Correct me if I'm wrong, but I think a market order is never open. You launch it and it gets filled immediately (except special circumstances), so you will almost never see it in the open orders. Could that be your issue?

@ePascalC Yep, probabily can be, but this happen with limit orders too, see this test order what i opened now:

clientOrderId: "xxxxxx"
cummulativeQuoteQty: "26.37347200"
executedQty: "359.90000000"
fills: [{}]
orderId: 741
orderListId: -1
origQty: "359.90000000"
price: "0.07328000"
side: "BUY"
status: "FILLED"
symbol: "TRXUSDT"
timeInForce: "GTC"
transactTime: 1628727827012
type: "LIMIT"

you have any idea why this happens?

@piusidev from the example, your status is 'Filled'. Open orders are orders that have been placed on the market but have yet to be filled. So if your order is in 'filled' state, it is not open and so you will not see it in the 'open' orders.