コード例 #1
0
        private void ProcessTick(ISerializedValue[] serializedData)
        {
            // Deserialize tick data
            TickData tickData;

            try
            {
                // Check if currenct pair is known
                if (ReferenceEquals(TickConverter.GetCurrencyPair(serializedData), null))
                {
                    Logger.Debug($"Received tick of unknown currency Pair '{ serializedData[0] }', skipping tick");
                    return;
                }

                // Convert tick
                tickData = TickConverter.Convert(Exchange, serializedData);

                Logger.Debug($"Received new tick: {tickData}");
            }
            catch (Exception e)
            {
                Logger.Error("Error deserializing tick data", e);
                return;
            }

            // Notify subscribers
            NotifySubscribers(tickData.CurrencyPair, s => s.OnTick(Exchange, tickData));
        }