/////<summary> ///// An id for a ratecurve. /////</summary> /////<param name="pricingStructureType">The pricing structure type.</param> /////<param name="curveName">The curve name.</param> /////<param name="buildDateTime">The build date time.</param> /////<param name="algorithm">The algorithm.</param> //public BondCurveIdentifier(PricingStructureTypeEnum pricingStructureType, string curveName, DateTime buildDateTime, string algorithm) // : base(pricingStructureType, curveName, buildDateTime, algorithm) //{ // SetProperties(PricingStructureType); //} /////<summary> ///// An id for a ratecurve. /////</summary> /////<param name="pricingStructureType"></param> /////<param name="curveName"></param> /////<param name="buildDateTime"></param> //public BondCurveIdentifier(PricingStructureTypeEnum pricingStructureType, string curveName, DateTime buildDateTime) // : this(pricingStructureType, curveName, buildDateTime, "Default") //{} ///// <summary> ///// An id for a ratecurve. ///// </summary> ///// <param name="curveId"></param> ///// <param name="baseDate"></param> //public BondCurveIdentifier(string curveId, DateTime baseDate) // : base(curveId) //{ // BaseDate = baseDate; // SetProperties(PricingStructureType); //} private void SetProperties() { switch (PricingStructureType) { case PricingStructureTypeEnum.BondDiscountCurve: case PricingStructureTypeEnum.BondCurve: string creditInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties); string creditSeniority = PropertyHelper.ExtractCreditSeniority(Properties); CreditInstrumentId = creditInstrumentId; CreditSeniority = creditSeniority; break; } }
private void SetProperties() { switch (PricingStructureType) { case PricingStructureTypeEnum.RateCurve: case PricingStructureTypeEnum.RateBasisCurve: ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor); break; case PricingStructureTypeEnum.RateSpreadCurve: case PricingStructureTypeEnum.ClearedRateCurve: ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor); ReferenceCurveTypeAndName = PropertyHelper.ExtractReferenceCurveName(Properties); ReferenceCurveUniqueId = PropertyHelper.ExtractReferenceCurveUniqueId(Properties); break; case PricingStructureTypeEnum.DiscountCurve: string creditInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties); string creditSeniority = PropertyHelper.ExtractCreditSeniority(Properties); CreditInstrumentId = InstrumentIdHelper.Parse(creditInstrumentId); CreditSeniority = CreditSeniorityHelper.Parse(creditSeniority); break; case PricingStructureTypeEnum.RateXccyCurve: //ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor); string discountInstrumentId = PropertyHelper.ExtractCreditInstrumentId(Properties); string discountSeniority = PropertyHelper.ExtractCreditSeniority(Properties); CreditInstrumentId = InstrumentIdHelper.Parse(discountInstrumentId); CreditSeniority = CreditSeniorityHelper.Parse(discountSeniority); ReferenceCurveTypeAndName = PropertyHelper.ExtractReferenceCurveName(Properties); ReferenceCurveUniqueId = PropertyHelper.ExtractReferenceCurveUniqueId(Properties); ReferenceFxCurveTypeAndName = PropertyHelper.ExtractReferenceFxCurveName(Properties); ReferenceFxCurveUniqueId = PropertyHelper.ExtractReferenceFxCurveUniqueId(Properties); ReferenceCurrency2CurveTypeAndName = PropertyHelper.ExtractReferenceCurrency2CurveName(Properties); ReferenceCurrency2CurveId = PropertyHelper.ExtractReferenceCurrency2CurveId(Properties); break; case PricingStructureTypeEnum.InflationCurve: ForecastRateIndex = ForecastRateIndexHelper.Parse(Index, IndexTenor); var inflationLag = PropertyHelper.ExtractInflationLag(Properties); if (inflationLag != "Unknown") { InflationLag = PeriodHelper.Parse(inflationLag); } break; case PricingStructureTypeEnum.XccySpreadCurve: PricingStructureType = PricingStructureTypeEnum.RateSpreadCurve; break; } }