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; }
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(); }); }