Ejemplo n.º 1
0
        //Clones a curve, maps the quoted assets specified and then returns an FpML structure back.
        //
        /// <summary>
        ///
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="cache"></param>
        /// <param name="nameSpace"></param>
        /// <param name="referenceCurve"></param>
        /// <param name="spreadValues"></param>
        /// <param name="properties"></param>
        /// <param name="fixingCalendar"></param>
        /// <param name="rollCalendar"></param>
        /// <returns></returns>
        public static Pair <PricingStructure, PricingStructureValuation> ProcessQuotedAssetSet(ILogger logger, ICoreCache cache,
                                                                                               string nameSpace, IRateCurve referenceCurve,
                                                                                               QuotedAssetSet spreadValues, NamedValueSet properties, IBusinessCalendar fixingCalendar, IBusinessCalendar rollCalendar)
        {
            var pricingStructureId = new RateCurveIdentifier(properties);
            Pair <PricingStructure, PricingStructureValuation> fpml = null;

            if (pricingStructureId.PricingStructureType != PricingStructureTypeEnum.RateBasisCurve)
            {
                //Clone the ref curves.
                //
                fpml = CloneCurve(referenceCurve.GetFpMLData(), pricingStructureId.UniqueIdentifier);
                //var ycCurveCloned = (YieldCurve)fpml.First;
                var ycvCurveCloned = (YieldCurveValuation)fpml.Second;
                //  assign id to the cloned YieldCurve
                //
                ycvCurveCloned.discountFactorCurve.point = null;
                ycvCurveCloned.zeroCurve    = null;
                ycvCurveCloned.forwardCurve = null;
                //Manipulate the quoted asset set.
                //
                ycvCurveCloned.inputs = MappedQuotedAssetSet(logger, cache, nameSpace, referenceCurve, spreadValues, properties, fixingCalendar, rollCalendar);
            }
            return(fpml);
        }