コード例 #1
0
        private void DepthClick(object sender, RoutedEventArgs e)
        {
            foreach (var security in SecurityPicker.SelectedSecurities)
            {
                var wnd = _quotesWindows.TryGetValue(security);

                if (wnd == null)
                {
                    // create order book window
                    wnd = new QuotesWindow
                    {
                        Title = security.Id + " " + LocalizedStrings.MarketDepth
                    };
                    _quotesWindows.Add(security, wnd);

                    // subscribe on order book flow
                    Trader.RegisterMarketDepth(security);

                    wnd.Show();
                    wnd.DepthCtrl.UpdateDepth(Trader.GetMarketDepth(security));
                }
                else
                {
                    Trader.UnRegisterMarketDepth(security);

                    _quotesWindows.Remove(security);

                    wnd.Close();
                }

                if (!_mdInitialized)
                {
                    Trader.MarketDepthChanged += TraderOnMarketDepthChanged;
                    _mdInitialized             = true;
                }
            }
        }
コード例 #2
0
        private void DepthClick(object sender, RoutedEventArgs e)
        {
            if (Depth.IsChecked == true)
            {
                // create order book window
                var wnd = new QuotesWindow {
                    Title = SelectedSecurity.Id + " " + LocalizedStrings.MarketDepth
                };
                _quotesWindows.Add(SelectedSecurity, wnd);

                // subscribe on order book flow
                Trader.RegisterMarketDepth(SelectedSecurity);

                wnd.Show();
            }
            else
            {
                Trader.UnRegisterMarketDepth(SelectedSecurity);

                var wnd = _quotesWindows[SelectedSecurity];
                _quotesWindows.Remove(SelectedSecurity);
                wnd.Close();
            }
        }
コード例 #3
0
        private void DepthClick(object sender, RoutedEventArgs e)
        {
            if (Depth.IsChecked == true)
            {
                // создаем окно со стаканом
                var wnd = new QuotesWindow {
                    Title = SelectedSecurity.Id + LocalizedStrings.Str2957
                };
                _quotesWindows.Add(SelectedSecurity, wnd);

                // начинаем получать котировки стакана
                Trader.RegisterMarketDepth(SelectedSecurity);

                wnd.Show();
            }
            else
            {
                Trader.UnRegisterMarketDepth(SelectedSecurity);

                var wnd = _quotesWindows[SelectedSecurity];
                _quotesWindows.Remove(SelectedSecurity);
                wnd.Close();
            }
        }
コード例 #4
0
		private void DepthClick(object sender, RoutedEventArgs e)
		{
			if (Depth.IsChecked == true)
			{
				// create order book window
				var wnd = new QuotesWindow { Title = SelectedSecurity.Id + " " + LocalizedStrings.MarketDepth };
				_quotesWindows.Add(SelectedSecurity, wnd);

				// subscribe on order book flow
				Trader.RegisterMarketDepth(SelectedSecurity);

				wnd.Show();
			}
			else
			{
				Trader.UnRegisterMarketDepth(SelectedSecurity);

				var wnd = _quotesWindows[SelectedSecurity];
				_quotesWindows.Remove(SelectedSecurity);
				wnd.Close();
			}
		}