void Setup()
        {
            SetTitle("Connecting");

            _reactiveTrader = new Domain.ReactiveTrader();
            _reactiveTrader.Initialize(UserModel.Instance.TraderId, new [] { "https://reactivetrader.azurewebsites.net/signalr" });
            _reactiveTrader.ConnectionStatusStream
            .Where(ci => ci.ConnectionStatus == ConnectionStatus.Connected)
            .Timeout(TimeSpan.FromSeconds(15))
            .ObserveOn(new EventLoopScheduler())
            .Subscribe(
                _ =>
            {
                SetTitle("Connected");
                Pairs.Shared.Clear();
            },
                ex => SetTitle("No connection")
                );

            _reactiveTrader
            .ConnectionStatusStream
            .Where(stream => stream.ConnectionStatus == ConnectionStatus.Closed)
            .Subscribe(_ => Pairs.Shared.Clear());

            IObservable <ICurrencyPairUpdate> onCurrencyPair =
                _reactiveTrader.ReferenceData
                .GetCurrencyPairsStream()
                .SelectMany(update => update);

            onCurrencyPair
            .Where(update => update.UpdateType == UpdateType.Add)
            .Where(update => !Pairs.Shared.Any(x => x.Symbol == update.CurrencyPair.Symbol))
            .Subscribe(update => Pairs.Shared.Add(update.CurrencyPair));

            onCurrencyPair
            .Where(update => update.UpdateType == UpdateType.Remove)
            .Subscribe(update => Pairs.Shared.Remove(update.CurrencyPair));

            onCurrencyPair
            .Throttle(TimeSpan.FromSeconds(1))
            .Subscribe(update => ReloadControllers());
        }
        void Setup()
        {
            SetTitle("Connecting");

            _reactiveTrader = new Domain.ReactiveTrader();
            _reactiveTrader.Initialize (UserModel.Instance.TraderId, new [] { "https://reactivetrader.azurewebsites.net/signalr" });  
            _reactiveTrader.ConnectionStatusStream
                .Where(ci => ci.ConnectionStatus == ConnectionStatus.Connected)
                .Timeout(TimeSpan.FromSeconds (15))
                .ObserveOn(new EventLoopScheduler())
                .Subscribe(
                    _ => 
                    {
                        SetTitle("Connected");
                        Pairs.Shared.Clear();
                    },
                    ex => SetTitle("No connection")
                );

            _reactiveTrader
                .ConnectionStatusStream
                .Where(stream => stream.ConnectionStatus == ConnectionStatus.Closed)
                .Subscribe(_ => Pairs.Shared.Clear());

            IObservable<ICurrencyPairUpdate> onCurrencyPair = 
                _reactiveTrader.ReferenceData
                    .GetCurrencyPairsStream()
                    .SelectMany(update => update);

            onCurrencyPair
                .Where(update => update.UpdateType == UpdateType.Add)                
                .Where(update => !Pairs.Shared.Any(x => x.Symbol == update.CurrencyPair.Symbol))
                .Subscribe(update => Pairs.Shared.Add(update.CurrencyPair));

            onCurrencyPair
                .Where(update => update.UpdateType == UpdateType.Remove)
                .Subscribe(update => Pairs.Shared.Remove(update.CurrencyPair));

            onCurrencyPair
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(update => ReloadControllers());
        }