public void Subscribe(List <string> symbols, CandleStickInterval interval)
        {
            SubscriptionOptions subOptions = new SubscriptionOptions
            {
                Method  = "subscribe",
                Topic   = "kline_" + interval.GetAttribute <Descriptor>().Identifier,
                Symbols = symbols
            };

            if (!this.symbolsSubscribedTo.ContainsKey(interval))
            {
                this.symbolsSubscribedTo.Add(interval, new List <string>());
            }

            foreach (string symbol in subOptions.Symbols)
            {
                if (!this.symbolsSubscribedTo[interval].Contains(symbol))
                {
                    this.symbolsSubscribedTo[interval].Add(symbol);
                }
                else
                {
                    subOptions.Symbols.Remove(symbol);
                }
            }

            this.WebSocket.Send(JsonConvert.SerializeObject(subOptions));
        }
        public void Unsubscribe(List <string> symbols, CandleStickInterval interval)
        {
            SubscriptionOptions subOptions = new SubscriptionOptions
            {
                Method  = "unsubscribe",
                Topic   = "kline_" + interval.GetAttribute <Descriptor>().Identifier,
                Symbols = symbols
            };

            this.symbolsSubscribedTo[interval].RemoveAll(x => subOptions.Symbols.Contains(x));

            this.WebSocket.Send(JsonConvert.SerializeObject(subOptions));
        }
        public void Unsubscribe(List <string> symbols)
        {
            SubscriptionOptions subOptions = new SubscriptionOptions
            {
                Method  = "unsubscribe",
                Topic   = "trades",
                Symbols = symbols
            };

            this.symbolsSubscribedTo.RemoveAll(symbols.Contains);

            this.WebSocket.Send(JsonConvert.SerializeObject(subOptions));
        }
        public void Subscribe(List <string> symbols)
        {
            string[] toAdd = symbols.Except(this.symbolsSubscribedTo).ToArray();

            if (!toAdd.Any())
            {
                return;
            }

            foreach (string symbol in toAdd)
            {
                this.symbolsSubscribedTo.Add(symbol);
            }

            SubscriptionOptions subOptions = new SubscriptionOptions
            {
                Method  = "subscribe",
                Topic   = "trades",
                Symbols = symbols
            };

            this.WebSocket.Send(JsonConvert.SerializeObject(subOptions));
        }