Beispiel #1
0
            public void UnSubscribe(Security security, MarketDataTypes type)
            {
                if (security == null)
                {
                    throw new ArgumentNullException("security");
                }

                if (security is IndexSecurity)
                {
                    ((IndexSecurity)security).InnerSecurities.ForEach(s => _connector.UnSubscribeMarketData(s, type));
                }
                else if (security is ContinuousSecurity)
                {
                    UnSubscribeContinuous((ContinuousSecurity)security, type);
                }
                else
                {
                    TryUnSubscribe(security, type);
                }
            }
            public void UnSubscribe(Security security, MarketDataMessage message)
            {
                if (security == null)
                {
                    throw new ArgumentNullException(nameof(security));
                }

                var indexSecurity = security as IndexSecurity;

                if (indexSecurity != null)
                {
                    indexSecurity.InnerSecurities.ForEach(s => _connector.UnSubscribeMarketData(s, message));
                }
                //else if (security is ContinuousSecurity)
                //	UnSubscribeContinuous((ContinuousSecurity)security, message);
                else
                {
                    //TryUnSubscribe(security, message);
                    _connector.SendInMessage(message);
                }
            }