private void Ok(object sender, RoutedEventArgs e)
        {
            try
            {
                var adapter = ((BasketMessageAdapter)_connector.TransactionAdapter).Portfolios.TryGetValue(Portfolios.SelectedPortfolio.Name);

                var sp = new SpeedTestStrategy(int.Parse(NumberOfTests.Text))
                {
                    Connector  = _connector,
                    Portfolio  = Portfolios.SelectedPortfolio,
                    Security   = Securities.SelectedSecurity,
                    Volume     = 1,
                    TraderName = adapter is QuikMessageAdapter
                                                        ? "Quik"
                                                                        : adapter is SmartComMessageAdapter ? "SmartCom" : "Plaza",
                };

                _connector.RegisterMarketDepth(sp.Security);
                MainWindow.Strategies.Add(sp);
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.ToString());
            }
        }
Esempio n. 2
0
		private void Ok(object sender, RoutedEventArgs e)
		{
			try
			{
				var adapter = ((BasketMessageAdapter)_connector.TransactionAdapter).Portfolios.TryGetValue(Portfolios.SelectedPortfolio.Name);

				var sp = new SpeedTestStrategy(int.Parse(NumberOfTests.Text))
				{
					Connector = _connector,
					Portfolio = Portfolios.SelectedPortfolio,
					Security = Securities.SelectedSecurity,
					Volume = 1,
					TraderName = adapter is QuikMessageAdapter
					             	? "Quik"
									: adapter is SmartComMessageAdapter ? "SmartCom" : "Plaza",
				};

				_connector.RegisterMarketDepth(sp.Security);
				MainWindow.Strategies.Add(sp);
				Close();
			}
			catch (Exception ex)
			{
				MessageBox.Show(this, ex.ToString());
			}
		}