Пример #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            // Console.WriteLine("................开始...................");

            //lt_trade = tt._lt_trade;
            //lt_trade_success = tt._lt_trade_success;
            //lt_submit_success = tt._lt_submit_success;

            IList <OrderField> openOrderEnumerable = this.ctpTrade.getOpenOrders();
            String             Title1            = "Part I 提交定单\n";
            String             List_submit_order = "";
            int ordinal = 1;

            foreach (OrderField openOrder in openOrderEnumerable)
            {
                List_submit_order += ordinal.ToString("D3") + " " + openOrder.ToShortString() + "\n";
                ordinal++;
            }//for

            String Title2 = "Part II 成交定单\n";
            IEnumerable <OrderField> filledOrderEnumerable = this.ctpTrade.getFilledOrders2();
            String List_submit_order_success = "";

            ordinal = 1;
            foreach (OrderField filledOrder in filledOrderEnumerable)
            {
                List_submit_order_success += ordinal.ToString("D3") + " " + filledOrder.ToShortString() + "\n";
                ordinal++;
            }

            String Title3 = "Part III 成交记录\n";

            trade_success_list = ctpTrade.getExecutioins();
            String List_trade_success = null;

            ordinal = 1;
            foreach (TradeField tradeField in trade_success_list)
            {
                List_trade_success += ordinal + " " + tradeField.OrderID + "---" + tradeField.Price + "\n";
                ordinal++;
            }

            richTextBox1.Text = Title1 + List_submit_order + Title2 + List_submit_order_success + Title3 + List_trade_success;
            //lt_trade;
            //lt_trade_success = tt._lt_trade_success;

            // Console.WriteLine("................结束...................");
        }