Exemplo n.º 1
0
        private static void Test_QuerySecurityIntradayOrder(RushQuantTradeClient client)
        {
            Console.WriteLine("******* QuerySecurityIntradayOrder BEGIN *********\n");

            QuerySecurityIntradayOrderInput input = new QuerySecurityIntradayOrderInput()
            {
            };
            QuerySecurityIntradayOrderOutput output = client.QuerySecurityIntradayOrder(input);

            Console.WriteLine($"{"委托日期",-10}{"委托时间",-10}{"委托编号",-10}{"股东代码",-10}{"交易所代码",-10}{"合约代码",-10}{"合约名称",-10}{"交易标志",-10}{"委托价格",-10}{"委托数量",-10}{"成交价格",-10}{"成交数量",-10}{"撤单数量",-10}{"报价类型",-10}{"状态",-10}");

            for (int i = 0; i < output.Count; i++)
            {
                QuerySecurityIntradayOrderOutputItem item = output.Items[i];
                Console.WriteLine($"{item.OrderDate,-14}{item.OrderTime,-14}{item.OrderID,-14}{item.StockholderCode,-14}{item.ExchangeId,-15}{item.InstrumentCode,-14}{item.InstrumentName,-10}{GetTradeFlagText(item.TradeFlag),-12}{item.OrderPrice,-14}{item.OrderVolume,-14}{item.DealPrice,-14}{item.DealVolume,-14}{item.CancelVolume,-14}{GetQuoteType(item.ExchangeId, item.QuoteType),-10}{GetStatusText(item.OrderStatus)}");
            }
            Console.WriteLine("******* QuerySecurityIntradayOrder END *********\n");
            Console.WriteLine();
        }
        public unsafe QuerySecurityIntradayOrderOutput QuerySecurityIntradayOrder(QuerySecurityIntradayOrderInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            byte *pInput  = stackalloc byte[QuerySecurityIntradayOrderInput.GetSize()];
            byte *pOutput = null;

            input.WriteTo(pInput);
            int result = UnsafeNativeMethods.rushquant_trade_QuerySecurityIntradayOrder(this._accountId, pInput, ref pOutput);
            QuerySecurityIntradayOrderOutput output = new QuerySecurityIntradayOrderOutput();

            output.ReadFrom(pOutput);
            UnsafeNativeMethods.rushquant_free(pOutput);
            if (result != ErrorCode.Success)
            {
                throw new RushQuantClientException(result, output.ErrorMessage);
            }

            return(output);
        }