Ejemplo n.º 1
0
        private void idLoginMenuItem_Click(object sender, EventArgs e)
        {
            LoginForm login = new LoginForm();

            login.TradeServerLogged += new EventHandler(
                (object s, EventArgs args) =>
            {
                //可增加其他监听处理
                //比如多账户:traderList.Add(s as CTPTrader);


                //处理登录成功事件
                ShowMessage("交易账户登录成功,开始初始化信息...");

                CTPTrader trader = s as CTPTrader;

                RegisterTraderResponseHandler(trader);

                trader.QueryInstrument();
                trader.QueryOrder();
                trader.QueryTrade();
                trader.QueryInvestorPositionDetail();
                trader.QueryTradingAccount();
                //确认结算单
                trader.SettlementInfoConfirm();
            });

            if (login.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.trader = login.Trader;
                this.quote  = login.Quote;

                RegisterQuoteResponseHandler(this.quote);
            }
        }
Ejemplo n.º 2
0
 private void idTradeQueryOrderMenuItem_Click(object sender, EventArgs e)
 {
     trader.QueryOrder();
 }