// constructor
        public Client(List <string> cryptocurrencies)
        {
            // builds the pricelist using a list of cryprocurrency market strings
            foreach (string cryptocurrency in cryptocurrencies)
            {
                CryptocurrencyData newCryptocurrencyData = new CryptocurrencyData(cryptocurrency);
                priceList.Add(newCryptocurrencyData);
            }

            // add the ticker channel to the channel list
            theChanelTypes = new List <ChannelType>()
            {
                ChannelType.Ticker
            };

            theProductTypes = parseProducts(cryptocurrencies);

            theCoinBaseProClient = new CoinbasePro.CoinbaseProClient();

            theWebSocket = theCoinBaseProClient.WebSocket;


            theWebSocket.Start(theProductTypes, theChanelTypes);

            // event handler for ticker received
            theWebSocket.OnTickerReceived += WebSocket_OnTickerReceived;
        }
        public void UpdateCryptocurrencyList(List <string> cryptocurrencies)
        {
            // empties the pricelist before adding the new data to it
            priceList.Clear();

            // builds the pricelist using a list of cryprocurrency market strings
            foreach (string cryptocurrency in cryptocurrencies)
            {
                CryptocurrencyData newCryptocurrencyData = new CryptocurrencyData(cryptocurrency);
                priceList.Add(newCryptocurrencyData);
            }

            // update the product types from the newly updated cryptocurrency list
            theProductTypes = parseProducts(cryptocurrencies);

            // restarts the websocket with the new list of currencies to listen for
            theWebSocket.Stop();
            theWebSocket.Start(theProductTypes, theChanelTypes);
        }
        public void updateRecordedData(CryptocurrencyData newData)
        {
            bool dataAdded = false;

            foreach (var item in theRecordedData)
            {
                if (item[0].market == newData.market)
                {
                    item.Add(newData);
                    dataAdded = true;
                    break;
                }
            }

            if (dataAdded == false)
            {
                // the recorded data does not yet have a list for this currency type
                List <CryptocurrencyData> newCryptocurrencyList = new List <CryptocurrencyData>();
                newCryptocurrencyList.Add(newData);

                theRecordedData.Add(newCryptocurrencyList);
            }
        }