How can I know which Buy order corresponds to which Sell order?

I want to write some code (in Python, Pandas) to measure the win rate (number of win orders/total number of orders) in a day (could be yesterday or the day before yesterday) for the BTCUSDT trading pair.

The problem I encountered was that there were many Buy orders and Sell orders mixed together. Including win and loss (Sell) orders.

I intend to use the similarity in “qty”, “quoteQty” and “price” between orders (buy - sell). But it seems quite complicated.
I want to ask, does the Binance API support finding Buy-Sell pairs?

Sorry my bad English!

Hey,
I think you can use the endpoint query all orders to check every Buy and Sell for each symbol.
This endpoint provides details such as price, timestamp, and quantity. With these information, you can easily compare various orders to analyze wins and losses effectively.

1 Like

Thank u, I’m doing the same!

You want to track the orderid and you will know which trade won.

1 Like