예제 #1
0
 public QuoteAdapter(TraderAdapter trader)
 {
     _trader               = trader;
     OnFrontConnected     += QuoteAdapter_OnFrontConnected;
     OnRspUserLogin       += QuoteAdapter_OnRspUserLogin;
     OnFrontDisconnected  += QuoteAdapter_OnFrontDisconnected;
     OnRspError           += QuoteAdapter_OnRspError;
     OnRspSubMarketData   += QuoteAdapter_OnRspSubMarketData;
     OnRspUnSubMarketData += QuoteAdapter_OnRspUnSubMarketData;
     OnRspUserLogout      += QuoteAdapter_OnRspUserLogout;
     OnRtnDepthMarketData += QuoteAdapter_OnRtnDepthMarketData;
 }
예제 #2
0
        public void CreateNewTrader()
        {
            Task.Run(() =>
            {
                Thread.Sleep(5000);
                var newTrader = new TraderAdapter
                {
                    BrokerId   = BrokerId,
                    InvestorId = InvestorId,
                    Password   = Password,
                    Front      = Front
                };

                ((QuoteAdapter)MyUtils.QuoteMain).Trader = newTrader;

                newTrader.Connect();
            });
        }