Ejemplo n.º 1
0
        public BitfinexMultipleNewOrderResponse SendMultipleOrders(BitfinexNewOrderPost[] orders)
        {
            try
            {
                var multipleOrdersPost = new BitfinexMultipleNewOrdersPost();
                multipleOrdersPost.Request = NewOrderRequestUrl + MultipleRequestUrl;
                multipleOrdersPost.Nonce   = Common.UnixTimeStampUtc().ToString();
                multipleOrdersPost.Orders  = orders;

                var client   = GetRestClient(multipleOrdersPost.Request);
                var response = GetRestResponse(client, multipleOrdersPost);

                var multipleOrderResponseObj = JsonConvert.DeserializeObject <BitfinexMultipleNewOrderResponse>(response.Content);
                MultipleOrderFeedMsg(multipleOrderResponseObj);

                Logger.Log.Info("Sending Multiple Orders:");
                foreach (var order in orders)
                {
                    Logger.Log.Info(order.ToString());
                }

                return(multipleOrderResponseObj);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(null);
            }
        }
Ejemplo n.º 2
0
        public BitfinexMultipleNewOrderResponse SendMultipleOrders(BitfinexNewOrderPost[] orders)
        {
            try
            {
                var multipleOrdersPost = new BitfinexMultipleNewOrdersPost
                {
                    Request = NewOrderRequestUrl + MultipleRequestUrl,
                    Nonce   = Common.UnixTimeStampUtc().ToString(CultureInfo.InvariantCulture),
                    Orders  = orders
                };

                // var client = GetRestClient(multipleOrdersPost.Request);
                var response = GetRestResponse(multipleOrdersPost);

                var multipleOrderResponseObj = JsonConvert.DeserializeObject <BitfinexMultipleNewOrderResponse>(response);

                Log.Info("Sending Multiple Orders:");
                foreach (var order in orders)
                {
                    Log.Info(order.ToString());
                }

                return(multipleOrderResponseObj);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(null);
            }
        }