public Connector _trader; public Connector _trader2; private void btnConnect_Click(object sender, RoutedEventArgs e) { Connection(); } private RealTimeEmulationTrader RealTimeQuikConnector() { object adress = "127.0.0.1:5001"; object pas = "quik"; var _tMessageAdapter = new QuikTrader() { LuaFixServerAddress = adress.To(), LuaLogin = "quik", LuaPassword = pas.To(), LogLevel = LogLevels.Info, }.MarketDataAdapter; RealTimeEmulationTrader _trader = new RealTimeEmulationTrader(_tMessageAdapter, new Portfolio() { BeginValue = 10000000, Name = "My" }); //{ UpdateSecurityByLevel1=true }; return _trader; } private QuikTrader RealQuikConnector() { object adress = "127.0.0.1:5001"; object pas = "quik"; QuikTrader _qtrader = new QuikTrader() { LuaLogin = "quik", LuaFixServerAddress = adress.To(), LuaPassword = pas.To() }; return _qtrader; } private void Connection() { _trader = RealTimeQuikConnector(); _trader2 = RealQuikConnector(); logManager.Sources.Add(_trader); logManager.Sources.Add(_trader2); _trader.Connected += () => this.GuiAsync(() => { _trader.AddErrorLog("Подключено."); }); _trader.ConnectionError += _error => this.GuiAsync(() => { _trader.AddErrorLog("Ошибка подключения"); _trader.AddErrorLog(_error); }); _trader.Connect(); _trader2.Connected += () => this.GuiAsync(() => { _trader2.AddErrorLog("Подключено."); }); _trader2.ConnectionError += _error => this.GuiAsync(() => { _trader.AddErrorLog("Ошибка подключения"); _trader.AddErrorLog(_error); }); _trader2.Connect(); }