Ejemplo n.º 1
0
        /// <summary>
        ///     listen to all obs, for make all properties updated
        /// </summary>
        private void SubscribeWebSocket()
        {
            //subscribe profile
            HttpClient.ProfileObservable
            .Merge(WsClient.ProfileObservable)
            .DistinctUntilChanged()
            .Where(x => x != null)
            .Subscribe(x => Profile = x);

            //subscribe for instrument updated
            WsClient.InstrumentResultSetObservable
            .Subscribe(x => Instruments = x);

            string requestId = Guid.NewGuid().ToString().Replace("-", string.Empty);

            //subscribe for Alerts Changed
            WsClient.SubscribeAlertChangedChanged(requestId);

            //subscribe for Alerts Triggered
            requestId = Guid.NewGuid().ToString().Replace("-", string.Empty);
            WsClient.SubscribeAlertTriggeredChanged(requestId);
        }