public HistoricalFacade(
     HistoricalRequestFormatter historicalRequestFormatter,
     LookupDispatcher lookupDispatcher,
     ExceptionFactory exceptionFactory,
     IHistoricalMessageHandler historicalMessageHandler,
     HistoricalFileFacade historicalFileFacade,
     TimeSpan timeout) : base(lookupDispatcher, exceptionFactory, timeout)
 {
     _historicalMessageHandler   = historicalMessageHandler;
     _historicalRequestFormatter = historicalRequestFormatter;
     File = historicalFileFacade;
 }
        public static LookupClient <T> CreateNew <T>(
            string host,
            int port,
            int numberOfClients,
            TimeSpan timeout,
            int bufferSize,
            IHistoricalMessageHandler <T> historicalMessageHandler)
        {
            // Common
            var requestFormatter         = new RequestFormatter();
            var lookupDispatcher         = new LookupDispatcher(host, port, bufferSize, IQFeedDefault.ProtocolVersion, numberOfClients, requestFormatter);
            var exceptionFactory         = new ExceptionFactory();
            var lookupMessageFileHandler = new LookupMessageFileHandler(lookupDispatcher, exceptionFactory, timeout);

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

            // News
            var newsFacade = new NewsFacade();

            // Symbol
            var symbolFacade = new SymbolFacade(
                new SymbolRequestFormatter(),
                lookupDispatcher,
                exceptionFactory,
                new SymbolMessageHandler(),
                new MarketSymbolDownloader(),
                new MarketSymbolReader(),
                new ExpiredOptionDownloader(),
                new ExpiredOptionReader(),
                timeout);

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

            return(new LookupClient <T>(lookupDispatcher, historicalFacade, newsFacade, symbolFacade, chainsFacade));
        }