Example #1
0
 private void RegisterAllNeededRawMaterialMarketData(PastaRecipeParser pastaRecipeParser)
 {
     // subscribes to all the marketdata we need to price the pasta we have to support
     foreach (var marketDataName in pastaRecipeParser.RawMaterialNames)
     {
         this.marketDataProvider.RegisterRawMaterial(marketDataName);
     }
 }
Example #2
0
        public void Start()
        {
            var pastaRecipeParser = new PastaRecipeParser(this.pastasConfiguration);

            this.RegisterAllNeededRawMaterialMarketData(pastaRecipeParser);

            this.InstantiateAndSetupPricingAgentsForAllPasta(pastaRecipeParser);
        }
Example #3
0
 private void RegisterAllNeededRawMaterialMarketData(PastaRecipeParser pastaRecipeParser)
 {
     // subscribes to all the marketdata we need to price the pasta we have to support
     foreach (var marketDataName in pastaRecipeParser.RawMaterialNames)
     {
         this.marketDataProvider.RegisterRawMaterial(marketDataName);
     }
 }
Example #4
0
        public void Start()
        {
            var pastaRecipeParser = new PastaRecipeParser(this.pastasConfiguration);

            this.RegisterAllNeededRawMaterialMarketData(pastaRecipeParser);

            this.InstantiateAndSetupPricingAgentsForAllPasta(pastaRecipeParser);
        }
Example #5
0
        private void InstantiateAndSetupPricingAgentsForAllPasta(PastaRecipeParser pastaRecipeParser)
        {
            // Instantiates pricing agents for all pastas
            foreach (var pastaName in pastaRecipeParser.Pastas)
            {
                var sequencerForThisPasta = this.unitOfExecution.BuildSequencer();
                var pastaPricingAgent     = new PastaPricingAgent(sequencerForThisPasta, pastaName, this.conflationEnabled);

                pastaPricingAgent.PastaPriceChanged += this.PastaPricingAgentPastaPriceChanged;

                this.pastaAgents.Add(pastaName, pastaPricingAgent);

                var marketDataForThisPasta = new List <IRawMaterialMarketData>();
                foreach (var rawMaterialName in pastaRecipeParser.GetNeededRawMaterialsFor(pastaName))
                {
                    marketDataForThisPasta.Add(this.marketDataProvider.GetRawMaterial(rawMaterialName));
                }

                pastaPricingAgent.SubscribeToMarketData(marketDataForThisPasta);
            }
        }
Example #6
0
        private void InstantiateAndSetupPricingAgentsForAllPasta(PastaRecipeParser pastaRecipeParser)
        {
            // Instantiates pricing agents for all pastas
            foreach (var pastaName in pastaRecipeParser.Pastas)
            {
                var sequencerForThisPasta = this.unitOfExecution.BuildSequencer();
                var pastaPricingAgent = new PastaPricingAgent(sequencerForThisPasta, pastaName, this.conflationEnabled);

                pastaPricingAgent.PastaPriceChanged += this.PastaPricingAgent_PastaPriceChanged;

                this.pastaAgents.Add(pastaName, pastaPricingAgent);

                var marketDataForThisPasta = new List<IRawMaterialMarketData>();
                foreach (var rawMaterialName in pastaRecipeParser.GetNeededRawMaterialsFor(pastaName))
                {
                    marketDataForThisPasta.Add(this.marketDataProvider.GetRawMaterial(rawMaterialName));
                }

                pastaPricingAgent.SubscribeToMarketData(marketDataForThisPasta);
            }
        }