Ejemplo n.º 1
0
        //Backs out the implied quotes for the asset provided and adds the spread to it.
        //
        protected static QuotedAssetSet MappedQuotedAssetSet(ILogger logger, ICoreCache cache,
                                                             string nameSpace, IInterpolatedSpace referenceCurve, QuotedAssetSet spreadValues,
                                                             NamedValueSet properties, IBusinessCalendar fixingCalendar, IBusinessCalendar rollCalendar)
        {
            var index    = 0;
            var baseDate = properties.GetValue <DateTime>(CurveProp.BaseDate);

            //Find the backed out implied quote for each asset.
            //
            foreach (var asset in spreadValues.instrumentSet.Items)
            {
                NamedValueSet namedValueSet = PriceableAssetFactory.BuildPropertiesForAssets(nameSpace, asset.id, baseDate);
                var           quote         = spreadValues.assetQuote[index];
                //Get the implied quote to use as the input market quote. Make sure it is rate controller.
                var priceableAsset = (PriceableRateAssetController)PriceableAssetFactory.Create(logger, cache, nameSpace, quote, namedValueSet, fixingCalendar, rollCalendar);
                var value          = priceableAsset.CalculateImpliedQuote(referenceCurve);
                //Replace the market quote in the bav and remove the spread.
                var quotes       = new List <BasicQuotation>(quote.quote);
                var impliedQuote = MarketQuoteHelper.ReplaceQuotationByMeasureType("MarketQuote", quotes, value);
                var marketQuote  = new List <BasicQuotation>(impliedQuote);
                spreadValues.assetQuote[index].quote = MarketQuoteHelper.MarketQuoteRemoveSpreadAndNormalise(marketQuote);
                index++;
            }
            return(spreadValues);
        }