コード例 #1
0
        public BitfinexCancelReplaceOrderResponse CancelReplaceOrder(int cancelOrderId, BitfinexNewOrderPost newOrder)
        {
            var replaceOrder = new BitfinexCancelReplacePost()
            {
                Amount        = newOrder.Amount,
                CancelOrderId = cancelOrderId,
                Exchange      = newOrder.Exchange,
                Price         = newOrder.Price,
                Side          = newOrder.Side,
                Symbol        = newOrder.Symbol,
                Type          = newOrder.Type
            };

            return(CancelReplaceOrder(replaceOrder));
        }
コード例 #2
0
        public BitfinexCancelReplaceOrderResponse CancelReplaceOrder(BitfinexCancelReplacePost replaceOrder)
        {
            replaceOrder.Request = OrderCancelRequestUrl + CancelReplaceRequestUrl;
            replaceOrder.Nonce   = Common.UnixTimeStampUtc().ToString(CultureInfo.InvariantCulture);

            var response = GetRestResponse(replaceOrder);

            var replaceOrderResponseObj = JsonConvert.DeserializeObject <BitfinexCancelReplaceOrderResponse>(response);

            replaceOrderResponseObj.OriginalOrderId = replaceOrder.CancelOrderId;

            Log.Info("Cancel Replace: {0}");
            Log.Info("Response From Exchange: {0}", replaceOrderResponseObj.ToString());

            return(replaceOrderResponseObj);
        }
コード例 #3
0
        public virtual BitfinexCancelReplaceOrderResponse CancelReplaceOrder(BitfinexCancelReplacePost replaceOrder)
        {
            replaceOrder.Request = OrderCancelRequestUrl + CancelReplaceRequestUrl;
            replaceOrder.Nonce   = Common.UnixTimeStampUtc().ToString();

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

            var replaceOrderResponseObj = JsonConvert.DeserializeObject <BitfinexCancelReplaceOrderResponse>(response.Content);

            replaceOrderResponseObj.OriginalOrderId = replaceOrder.CancelOrderId;

            Log.Trace(string.Format("BitfinexApi.CancelReplaceOrder(): {0}"));
            Log.Trace(string.Format("BitfinexApi.CancelReplaceOrder(): Response From Exchange: {0}", replaceOrderResponseObj.ToString()));

            return(replaceOrderResponseObj);
        }
コード例 #4
0
 public Task <BitfinexCancelReplaceOrderResponse> CancelReplaceOrderAsync(BitfinexCancelReplacePost replaceOrder)
 {
     return(Task.Run(() => CancelReplaceOrder(replaceOrder)));
 }