示例#1
0
        private void SecurityPicker_OnSecuritySelected(Security security)
        {
            if (security == null)
            {
                return;
            }

            if (_candlesSubscription != null)
            {
                _emuConnector.UnSubscribe(_candlesSubscription);                 // give back series memory
            }
            _security = security;

            Chart.Reset(new[] { _candlesElem });

            _emuConnector.SubscribeMarketDepth(security);
            _emuConnector.SubscribeTrades(security);
            _emuConnector.SubscribeLevel1(security);

            _candlesSubscription = _emuConnector.SubscribeCandles(new CandleSeries(CandleSettingsEditor.Settings.CandleType, security, CandleSettingsEditor.Settings.Arg), from: DateTimeOffset.UtcNow - TimeSpan.FromDays(10));
        }