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)); }
private void SecurityPicker_OnSecuritySelected(Security security) { if (security == null) { return; } if (_candleSeries != null) { _emuConnector.UnSubscribeCandles(_candleSeries); // give back series memory } _security = security; Chart.Reset(new[] { _candlesElem }); _emuConnector.SubscribeMarketDepth(security); _emuConnector.SubscribeTrades(security); _emuConnector.SubscribeLevel1(security); _candleSeries = new CandleSeries(CandleSettingsEditor.Settings.CandleType, security, CandleSettingsEditor.Settings.Arg); _emuConnector.SubscribeCandles(_candleSeries); }