/// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <String> GetRequiredPricingStructures()
        {
            var result = new List <String>();

            if (calculationPeriodAmount.Item is Calculation amount)
            {
                var currency = XsdClassesFieldResolver.CalculationGetNotionalSchedule(amount);
                if (currency?.notionalStepSchedule != null)
                {
                    var discountCurve = CurveNameHelpers.GetDiscountCurveName(currency.notionalStepSchedule.currency, true);
                    result.Add(discountCurve);
                }
                if (amount.Items[0] is FloatingRateCalculation floatingRateCalculation)
                {
                    result.Add(CurveNameHelpers.GetForecastCurveName(floatingRateCalculation.floatingRateIndex, floatingRateCalculation.indexTenor));
                }
            }
            //TODO
            if (stubCalculationPeriodAmount != null)
            {
                if (stubCalculationPeriodAmount.initialStub?.Items != null)
                {
                    result.AddRange(from value in stubCalculationPeriodAmount.initialStub.Items
                                    where value is Money
                                    select CurveNameHelpers.GetDiscountCurveName(((Money)value).currency, true));
                }
                if (stubCalculationPeriodAmount.finalStub?.Items != null)
                {
                    result.AddRange(from value in stubCalculationPeriodAmount.finalStub.Items
                                    where value is Money
                                    select CurveNameHelpers.GetDiscountCurveName(((Money)value).currency, true));
                }
            }
            return(result);
        }
示例#2
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public override List <string> GetRequiredPricingStructures()
        {
            var result = new List <string>();

            if (notional.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(notional.currency, true);
                result.Add(discountCurve);
            }
            if (floatingRateIndex != null && indexTenor != null)
            {
                result.Add(CurveNameHelpers.GetForecastCurveName(floatingRateIndex, indexTenor[0]));
            }
            return(result);
        }