public LookupClient(
     LookupDispatcher lookupDispatcher,
     HistoricalFacade historical,
     NewsFacade news,
     SymbolFacade symbol,
     ChainsFacade chains,
     MarketSummaryFacade marketSummary)
 {
     _lookupDispatcher = lookupDispatcher;
     Historical        = historical;
     News          = news;
     Symbol        = symbol;
     Chains        = chains;
     MarketSummary = marketSummary;
 }
        public static LookupClient CreateNew(
            string host,
            int port,
            int numberOfClients,
            TimeSpan timeout,
            int bufferSize,
            int requestsPerSecond)
        {
            // Common
            var requestFormatter         = new RequestFormatter();
            var lookupDispatcher         = new LookupDispatcher(host, port, bufferSize, IQFeedDefault.ProtocolVersion, numberOfClients, requestFormatter);
            var lookupRateLimiter        = new LookupRateLimiter(requestsPerSecond);
            var exceptionFactory         = new ExceptionFactory();
            var lookupMessageFileHandler = new LookupMessageFileHandler(lookupDispatcher, lookupRateLimiter, exceptionFactory, timeout);
            var historicalMessageHandler = new HistoricalMessageHandler();

            // Historical
            var historicalDataRequestFormatter = new HistoricalRequestFormatter();
            var historicalFileFacade           = new HistoricalFileFacade(historicalDataRequestFormatter, lookupMessageFileHandler);
            var historicalFacade = new HistoricalFacade(
                historicalDataRequestFormatter,
                lookupDispatcher,
                lookupRateLimiter,
                exceptionFactory,
                historicalMessageHandler,
                historicalFileFacade,
                timeout
                );

            // News
            var newsFacade = new NewsFacade(
                new NewsRequestFormatter(),
                lookupDispatcher,
                lookupRateLimiter,
                exceptionFactory,
                new NewsMessageHandler(),
                timeout);

            // Symbol
            var symbolFacade = new SymbolFacade(
                new SymbolRequestFormatter(),
                lookupDispatcher,
                lookupRateLimiter,
                exceptionFactory,
                new SymbolMessageHandler(),
                new MarketSymbolReader(),
                new ExpiredOptionReader(),
                new FileDownloader(new LocalCacheStrategy()),
                timeout);

            // Chains
            var chainsFacade = new ChainsFacade(
                new ChainsRequestFormatter(),
                new ChainsMessageHandler(),
                lookupDispatcher,
                lookupRateLimiter,
                exceptionFactory,
                timeout);

            // MarketSummary
            var marketSummaryFacade = new MarketSummaryFacade(new MarketSummaryRequestFormatter(), lookupDispatcher, lookupRateLimiter, exceptionFactory, timeout);

            return(new LookupClient(lookupDispatcher, historicalFacade, newsFacade, symbolFacade, chainsFacade, marketSummaryFacade));
        }