Exemple #1
0
 unsafe private static extern FFIResult PlaceOrder(IntPtr client, string market,
                                                   string qty,
                                                   bool limit,
                                                   string price,
                                                   Side side,
                                                   TimeInForce tif,
                                                   ulong tifDuration,
                                                   bool postOnly,
                                                   out FFIOrder order
                                                   );
Exemple #2
0
        unsafe public IEnumerable <Order> GetAllOpenOrders()
        {
            var orders     = new FFIOrder[256];
            var ordersLen  = orders.Length;
            var ordersList = new List <Order>();


            fixed(FFIOrder *orderBuff = orders.AsSpan())
            {
                handleResult(ExchangeClient.GetAllOpenOrders(
                                 _client_handle,
                                 (IntPtr)orderBuff, (UIntPtr)ordersLen, out var actualCandleLen
                                 ));
                for (int i = 0; i < (int)actualCandleLen; i++)
                {
                    ordersList.Add(orderBuff[i].ToOrder());
                    orderBuff[i].Dispose();
                }
            }

            return(ordersList);
        }
Exemple #3
0
        unsafe public IEnumerable <Order> GetOrderHistory(GetOrderHistoryRequest req)
        {
            var limit      = req.paginator == null ? 0 : req.paginator.limit;
            var orders     = new FFIOrder[Math.Max(limit, 256)];
            var ordersLen  = orders.Length;
            var ordersList = new List <Order>();


            fixed(FFIOrder *orderBuff = orders.AsSpan())
            {
                handleResult(ExchangeClient.GetOrderHistory(
                                 _client_handle,
                                 req.market, req.paginator,
                                 (IntPtr)orderBuff, (UIntPtr)ordersLen, out var actualCandleLen
                                 ));
                for (int i = 0; i < (int)actualCandleLen; i++)
                {
                    ordersList.Add(orderBuff[i].ToOrder());
                    orderBuff[i].Dispose();
                }
            }

            return(ordersList);
        }
Exemple #4
0
 unsafe private static extern FFIResult GetOrder(IntPtr client, string orderId, string market, out FFIOrder result);