public QuotationManager( QuotV5.Binary.RealTimeQuotConnection[] quotConnections, QuotationRepository quotRepository, QuotationMQPublisher quotPublisher, SecurityInfoProvider securityInfoProvider, IndexInfoProvider indexInfoProvider, CashAuctionParamsProvider cashAuctionParamsProvider, DerivativeAuctionParamsProvider derivativeAuctionParamsProvider, NegotiationParamsProvider negotiationParamsProvider, SecurityCloseMDProvider securityCloseMDProvider, Log4cb.ILog4cbHelper logHelper ) { this.quotConnections = quotConnections; this.quotRepository = quotRepository; this.quotPublisher = quotPublisher; this.securityInfoProvider = securityInfoProvider; this.indexInfoProvider = indexInfoProvider; this.cashAuctionParamsProvider = cashAuctionParamsProvider; this.derivativeAuctionParamsProvider = derivativeAuctionParamsProvider; this.negotiationParamsProvider = negotiationParamsProvider; this.securityCloseMDProvider = securityCloseMDProvider; this.logHelper = logHelper; foreach (var conn in this.quotConnections) conn.OnMarketDataReceived += new Action<QuotV5.Binary.MarketDataEx>(QuotConn_OnMarketDataReceived); this.securityInfoProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.SecurityInfoBase>>(SecurityInfoProvider_OnStaticInfoRead); this.indexInfoProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.IndexInfo>>(IndexInfoProvider_OnStaticInfoRead); this.cashAuctionParamsProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.CashAuctionParams>>(CashAuctionParamsProvider_OnStaticInfoRead); this.derivativeAuctionParamsProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.DerivativeAuctionParams>>(DerivativeAuctionParamsProvider_OnStaticInfoRead); this.negotiationParamsProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.NegotiationParams>>(NegotiationParamsProvider_OnStaticInfoRead); //this.securityCloseMDProvider.OnStaticInfoRead += new Action<List<QuotV5.StaticInfo.SecurityCloseMD>>(SecurityCloseMDProvider_OnStaticInfoRead); }
internal void ConstructQuotManager() { MongoMessagePackRecorder recorder = new MongoMessagePackRecorder("192.168.1.167", 6678, this.logHelper); QuotV5.Binary.RealTimeQuotConnection stockRealtimeQuotConn = ConstructRealTimeQuotConnection("StockRealtime", recorder); QuotV5.Binary.RealTimeQuotConnection optionRealtimeQuotConn = ConstructRealTimeQuotConnection("OptionRealtime", recorder); QuotationRepository quotRepository = new QuotationRepository(); QuotationMQPublisherConfig publisherConfig = new QuotationMQPublisherConfig() { Address = PluginContext.Configuration.ActiveMQ.Address, RecordsPerPackage = PluginContext.Configuration.ActiveMQ.RecordsPerPackage }; QuotationMQPublisher quotPublisher = new QuotationMQPublisher(publisherConfig, this.logHelper); StaticInfoProviderConfig securityInfoProviderConfig = GetStaticInfoProviderConfig("Securities"); SecurityInfoProvider securityInfoProvider = new SecurityInfoProvider(securityInfoProviderConfig, this.logHelper); StaticInfoProviderConfig indexInfoProviderConfig = GetStaticInfoProviderConfig("IndexInfo"); IndexInfoProvider indexInfoProvider = new IndexInfoProvider(indexInfoProviderConfig, this.logHelper); StaticInfoProviderConfig cashAuctionParamsProviderConfig = GetStaticInfoProviderConfig("CashAuctionParams"); CashAuctionParamsProvider cashAuctionParamsProvider = new CashAuctionParamsProvider(cashAuctionParamsProviderConfig, this.logHelper); StaticInfoProviderConfig derivativeAuctionParamsProviderConfig = GetStaticInfoProviderConfig("DerivativeAuctionParams"); DerivativeAuctionParamsProvider derivativeAuctionParamsProvider = new DerivativeAuctionParamsProvider(derivativeAuctionParamsProviderConfig, this.logHelper); StaticInfoProviderConfig negotiationParamsProviderConfig = GetStaticInfoProviderConfig("NegotiationParams"); NegotiationParamsProvider negotiationParamsProvider = new NegotiationParamsProvider(negotiationParamsProviderConfig, this.logHelper); StaticInfoProviderConfig securityCloseMDProviderConfig = GetStaticInfoProviderConfig("SecurityCloseMD"); SecurityCloseMDProvider securityCloseMDProvider = new SecurityCloseMDProvider(securityCloseMDProviderConfig, this.logHelper); this.quotManager = new QuotationManager( //new QuotV5.Binary.RealTimeQuotConnection[] { optionRealtimeQuotConn }, new QuotV5.Binary.RealTimeQuotConnection[] { stockRealtimeQuotConn, optionRealtimeQuotConn }, quotRepository, quotPublisher, // null, securityInfoProvider, indexInfoProvider, cashAuctionParamsProvider, derivativeAuctionParamsProvider, negotiationParamsProvider, securityCloseMDProvider, this.logHelper ); QuotationSnapServiceConfig sc = new QuotationSnapServiceConfig() { Address = PluginContext.Configuration.ActiveMQ.Address, RecordsPerPackage = PluginContext.Configuration.ActiveMQ.RecordsPerPackage }; this.quotSnapService = new QuotationSnapService(sc, quotPublisher, this.logHelper); }