How to get all past orders

Hi,

Is there a way in binance API to get all past orders? I want to calculate the unrealized PNL and realized PNL by going through all past orders and calculating these.

I looked at the C# API that I am using but I don’t see anything about past orders, only the current orders.

How can I do this?

Thanks a lot!

Currently, you can only get historical orders using the /api/v3/historicalTrades endpoint (see https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#old-trade-lookup-market_data)

However, there’s a longstanding issue (see thread Fetch all account orders) with his endpoint considering it requires you to add a symbol as a parameter (thus fetching historical orders by symbol, rather than fetching them all).

Thanks a lot I wonder when or if binance will implement this, as they are not a new exchange.

Because right now I can go through the coins I have in my account right? But how can I find out the prices they were bought and sold? Because I might buy 1000 then sell 500, then buy 200, then sell all, then buy 400, then sell 100, etc. I will try to figure out until I have the same balance in a particular coin no?

Another issue is, how can I figure out which pair was used in a trade. Does your link show it? I tried to look at it, but for some reason I cant scroll in that page.

Hey. I am looking for same solution. Did you find anything on this?