public void HandlePublishedNewRequestEvent(NewRequestForQuoteEventPayload eventPayload) { if (eventPayload == null) { throw new ArgumentNullException("eventPayload"); } IRequestForQuote request = new RequestForQuoteImpl(); request.Legs = optionRequestParser.ParseRequest(eventPayload.NewRequestText.ToUpper(), request); request.Request = eventPayload.NewRequestText; request.Status = StatusEnum.PENDING; request.Identifier = -1; request.Client = eventPayload.NewRequestClient; request.TradeDate = DateTime.Today; if (request.Legs != null) { request.ExpiryDate = request.Legs[0].MaturityDate; } request.LotSize = 100; request.Multiplier = 10; request.Contracts = 100; request.NotionalFXRate = 1; request.NotionalMillions = 1; request.BookCode = eventPayload.NewRequestBookCode; request.DayCountConvention = 250.0; request.PremiumSettlementFXRate = 1; request.SalesCreditFXRate = 1; request.IsOTC = true; request.SalesCreditPercentage = 2; request.PremiumSettlementDaysOverride = 1; request.PremiumSettlementDate = DateTime.Today.AddDays(request.PremiumSettlementDaysOverride); request.CalculatePricing(optionRequestPricer); TodaysRequests.Add(request); Requests.Clear(); Requests.AddRange(TodaysRequests); NotifyPropertyChanged("Requests"); // TODO - add all fields with their defaults. if (log.IsDebugEnabled) { log.Debug("Received and prcoessed published new request for quote => " + request); } }
public void AddRequest() { if (optionRequestParser.IsValidOptionRequest(NewRequest)) { var payLoad = new NewRequestForQuoteEventPayload() { NewRequestText = this.NewRequest, NewRequestClient = this.NewRequestClient, }; if (this.NewRequestBook != null && this.NewRequestBook.BookCode != null) { payLoad.NewRequestBookCode = this.NewRequestBook.BookCode; } eventAggregator.GetEvent <NewRequestForQuoteEvent>().Publish(payLoad); if (log.IsDebugEnabled) { log.Debug("Published new request for quote => " + this.NewRequest); } } }