private async Task TradeHistoryAsync(CancellationToken cancellationToken) { // look up documentation to get all available filters var request = new TradeHistoryRequest(MarginAccountId, symbol: "XBTUSD"); var trades = await _restClient.TradeHistoryAsync(request, cancellationToken) .ConfigureAwait(false); var toPrint = string.Join("\n", trades.Select(p => p.ToString())); _logger.LogInformation($"Trades history: {toPrint}"); }
public async Task Test_TradeHistory() { var request = new TradeHistoryRequest(MarginAccountId) { // TradeId = "177ed192-03e8-4f7c-9f69-bbfc32101cab", // ClOrdId = "KwdVbYloR", // Symbol = "XBTUSD", // From = DateTime.Parse("2019-08-02T08:04:42Z").ToUniversalTime(), // To = DateTime.Parse("2019-08-02T08:04:44Z").ToUniversalTime(), // PageNumber = 2, // Limit = 2, }; var trades = await _restClient.TradeHistoryAsync(request, _token).ConfigureAwait(false); trades.Should().NotBeNull(); trades.Should().NotBeNull(); trades.Length.Should().BeGreaterThan(0); }