private void DepthClick(object sender, RoutedEventArgs e)
        {
            var trader = MainWindow.Instance.Trader;

            var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
            {
                // начинаем получать котировки стакана
                trader.RegisterMarketDepth(security);

                // создаем окно со стаканом
                var wnd = new QuotesWindow {
                    Title = security.Id + " " + LocalizedStrings.MarketDepth
                };
                wnd.MakeHideable();
                return(wnd);
            });

            if (window.Visibility == Visibility.Visible)
            {
                window.Hide();
            }
            else
            {
                window.Show();
            }

            if (!_initialized)
            {
                TraderOnMarketDepthsChanged(new[] { trader.GetMarketDepth(SecurityPicker.SelectedSecurity) });
                trader.MarketDepthsChanged += TraderOnMarketDepthsChanged;
                _initialized = true;
            }
        }
Esempio n. 2
0
        private void DepthClick(object sender, RoutedEventArgs e)
        {
            var trader = MainWindow.Instance.Trader;

            var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
            {
                // subscribe on order book flow
                trader.RegisterOrderLog(security);

                // create order book window
                var wnd = new QuotesWindow {
                    Title = security.Id + " " + LocalizedStrings.MarketDepth
                };
                wnd.MakeHideable();
                return(wnd);
            });

            if (window.Visibility == Visibility.Visible)
            {
                window.Hide();
            }
            else
            {
                window.Show();
            }

            if (!_initialized)
            {
                TraderOnMarketDepthsChanged(new[] { trader.GetMarketDepth(SecurityPicker.SelectedSecurity) });
                trader.MarketDepthsChanged += TraderOnMarketDepthsChanged;
                _initialized = true;
            }
        }
Esempio n. 3
0
		private void DepthClick(object sender, RoutedEventArgs e)
		{
			var trader = MainWindow.Instance.Trader;

			var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
			{
				// subscribe on order book flow
				trader.RegisterOrderLog(security);

				// create order book window
				var wnd = new QuotesWindow { Title = security.Id + " " + LocalizedStrings.MarketDepth };
				wnd.MakeHideable();
				return wnd;
			});

			if (window.Visibility == Visibility.Visible)
				window.Hide();
			else
				window.Show();

			if (!_initialized)
			{
				TraderOnMarketDepthsChanged(new[] { trader.GetMarketDepth(SecurityPicker.SelectedSecurity) });
				trader.MarketDepthsChanged += TraderOnMarketDepthsChanged;
				_initialized = true;
			}
		}
Esempio n. 4
0
		private void DepthClick(object sender, RoutedEventArgs e)
		{
			var trader = MainWindow.Instance.Trader;

			var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
			{
				// начинаем получать котировки стакана
				trader.RegisterMarketDepth(security);

				// создаем окно со стаканом
				var wnd = new QuotesWindow { Title = security.Id + " " + LocalizedStrings.MarketDepth };
				wnd.MakeHideable();
				return wnd;
			});

			if (window.Visibility == Visibility.Visible)
				window.Hide();
			else
				window.Show();

			if (!_initialized)
			{
				TraderOnMarketDepthsChanged(new[] { trader.GetMarketDepth(SecurityPicker.SelectedSecurity) });
				trader.MarketDepthsChanged += TraderOnMarketDepthsChanged;
				_initialized = true;
			}
		}