I’m working on pulling off the historical trades for the accountants. How do I get all historical trades for a symbol in batches of 100 elements?
I found two endpoints /api/v3/myTrades and /api/v3/allOrders. The former one seems to be getting the trades for a specific account and symbol. The latter gets all account orders; active, canceled, or filled.
var userTrades1 = await _restClient.SpotApi.Trading.GetUserTradesAsync("TRXUSDT", fromId: 0, limit: 50);
var fromId = start.Data.Last().OrderId + 1;
var userTrades2 = await _restClient.SpotApi.Trading.GetUserTradesAsync("TRXUSDT", fromId: fromId, limit: 50);
I use Binance.Net. Look at the snippet above, the last order id in userTrades1 is 155806 and fromId is set to 155806 + 1. The first element in userTrades2 has order id 49976538. I expect to get the data sequentially in batches of 100 elements (limit: 100).
How do I get all historical trades for a symbol in batches of 100 elements?