Ejemplo n.º 1
0
        public async Task <Order> PlaceLimitGTCOrderAsync(
            Sides orderSide,
            string productId,
            decimal price,
            decimal size,
            Guid clientOrderId,
            OrderSelfTradePreventionFlags selfTradePreventionFlag = OrderSelfTradePreventionFlags.DecreaseAndCancel
            )
        {
            var orderRequest = new OrderRequest
            {
                OrderSide               = orderSide.GetString(),
                OrderType               = OrderTypes.Limit.GetString(),
                TimeInForceFlag         = LimitOrderTimeInForceFlags.GTC.GetString(),
                ProductId               = productId,
                Price                   = price,
                Size                    = size,
                SelfTradePreventionFlag = selfTradePreventionFlag.GetString(),
                ClientOrderId           = clientOrderId,
                PostOnly                = true
            };

            return(await Client.InvokeSecureRequestWithBody <OrderRequest, Order>(
                       CredentialsProvider,
                       HttpMethod.Post,
                       OrdersEndpoint,
                       orderRequest));
        }