Ejemplo n.º 1
0
        private static void CancelOrdersByCriteria()
        {
            var tradeClient = new OrderClient(Config.AccessKey, Config.SecretKey);

            _logger.Start();
            var request = new CancelOrdersByCriteriaRequest
            {
                AccountId = Config.AccountId
            };
            var response = tradeClient.CancelOrdersByCriteriaAsync(request).Result;

            _logger.StopAndLog();

            switch (response.status)
            {
            case "ok":
            {
                if (response.data != null)
                {
                    var d = response.data;
                    AppLogger.Info($"Cancel success: {d.successCount}, fail: {d.failedCount}, next: {d.nextId}");
                }
                break;
            }

            case "error":
            {
                AppLogger.Info($"Cancel orders fail, error code: {response.errorCode}, error message: {response.errorMessage}");
                break;
            }
            }
        }