예제 #1
0
        // [InlineData(null, null, 42000, 1, "buy", "open", 5, "limit", "swap", "btc-usdt")]
        // [InlineData(null, null, 42000, 1, "buy", "open", 5, "limit", "quarter", "btc-usdt")]
        // [InlineData("btc-usdt-220121", null, 42000, 1, "buy", "open", 5, "limit", "quarter", "btc-usdt")]
        // [InlineData("btc-husd", null, 42000, 1, "buy", "open", 5, "limit", null, null)]
        // [InlineData(null, null, 42000, 1, "buy", "open", 5, "limit", "swap", "btc-husd")]
        // [InlineData(null, null, 42000, 1, "buy", "open", 5, "limit", "quarter", "btc-husd")]
        // [InlineData("btc-husd-220121", null, 42000, 1, "buy", "open", 5, "limit", "quarter", "btc-husd")]
        public void CrossPlaceBatchOrderTest(string contractCode, long?clientOrderId, float price, long volume, string direction,
                                             string offset, int leverRate, string orderPriceType, string contractType, string pair,
                                             int?reduceOnly)
        {
            Order.PlaceOrderRequest[] request2 =
            {
                new Order.PlaceOrderRequest
                {
                    contractCode   = contractCode,
                    clientOrderId  = clientOrderId,
                    price          = price,
                    volume         = volume,
                    direction      = direction,
                    offset         = offset,
                    leverRate      = leverRate,
                    orderPriceType = orderPriceType,
                    contractType   = contractType,
                    pair           = pair,
                    reduceOnly     = reduceOnly
                }
            };
            var result = client.CrossPlaceBatchOrderAsync(request2).Result;
            var strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);

            Console.WriteLine("------------");
        }
예제 #2
0
        public void PlaceBatchOrderTest()
        {
            Order.PlaceOrderRequest[] request =
            {
                new Order.PlaceOrderRequest
                {
                    contractCode   = "XRP-USDT",
                    clientOrderId  = null,
                    price          = 0.15,
                    volume         = 1,
                    direction      = "buy",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit"
                },
                new Order.PlaceOrderRequest
                {
                    contractCode   = "XRP-USDT",
                    clientOrderId  = null,
                    price          = 0.18,
                    volume         = 1,
                    direction      = "buy",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit"
                }
            };
            var    result = client.IsolatedPlaceBatchOrderAsync(request).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);

            result = client.CrossPlaceBatchOrderAsync(request).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);
        }
예제 #3
0
        public void PlaceBatchOrderTest()
        {
            Order.PlaceOrderRequest[] request1 =
            {
                new Order.PlaceOrderRequest
                {
                    contractCode   = "SHIB-USDT",
                    clientOrderId  = null,
                    price          = 0.00003,
                    volume         = 1,
                    direction      = "buy",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit"
                },
                new Order.PlaceOrderRequest
                {
                    contractCode   = "SHIB-USDT",
                    clientOrderId  = null,
                    price          = 0.00004,
                    volume         = 1,
                    direction      = "sell",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit"
                }
            };
            var    result = client.IsolatedPlaceBatchOrderAsync(request1).Result;
            string strret = JsonConvert.SerializeObject(result, Formatting.Indented);

            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);

            Order.PlaceOrderRequest[] request2 =
            {
                new Order.PlaceOrderRequest
                {
                    contractCode   = "SHIB-USDT",
                    clientOrderId  = null,
                    price          = 0.00003,
                    volume         = 1,
                    direction      = "buy",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit",
                    contractType   = "swap",
                    pair           = "btc-usdt"
                },
                new Order.PlaceOrderRequest
                {
                    contractCode   = "SHIB-USDT",
                    clientOrderId  = null,
                    price          = 0.00004,
                    volume         = 1,
                    direction      = "sell",
                    offset         = "open",
                    leverRate      = 5,
                    orderPriceType = "limit"
                }
            };
            result = client.CrossPlaceBatchOrderAsync(request2).Result;
            strret = JsonConvert.SerializeObject(result, Formatting.Indented);
            Console.WriteLine(strret);
            Assert.Equal("ok", result.status);

            Console.WriteLine("------------");
        }