Ejemplo n.º 1
0
        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);
        }
        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);
        }