示例#1
0
        public async Task Test_ListOpenPositions()
        {
            var positions = await _restClient.ListOpenPositionsAsync(MarginAccountId, _token).ConfigureAwait(false);

            positions.Should().NotBeNull();
            positions.Should().NotBeNull();
            positions.Length.Should().BeGreaterThan(0);
        }
        private async Task GetOpenPositionsAsync(CancellationToken cancellationToken)
        {
            var positions = await _restClient.ListOpenPositionsAsync(MarginAccountId, cancellationToken)
                            .ConfigureAwait(false);

            var toPrint = string.Join("\n", positions.Select(p => p.ToString()));

            _logger.LogInformation($"Open positions: {toPrint}");
        }