Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <string> GetRequiredCurrencies()
        {
            var result = new List <string>();
            var item   = XsdClassesFieldResolver.CalculationGetNotionalSchedule((Calculation)calculationPeriodAmount.Item);

            if (item?.notionalStepSchedule?.currency != null)
            {
                result.Add(item.notionalStepSchedule.currency.Value);
            }
            return(result);
        }
Exemplo n.º 3
0
        ///<summary>
        /// Gets all the Forecast curve name.
        ///</summary>
        ///<returns></returns>
        public static string GetRateVolatilityMatrixName(Swap swap)
        {
            AdjustableDate adjustableEffectiveDate   = XsdClassesFieldResolver.CalculationPeriodDatesGetEffectiveDate(swap.swapStream[0].calculationPeriodDates);
            AdjustableDate adjustableTerminationDate = XsdClassesFieldResolver.CalculationPeriodDatesGetTerminationDate(swap.swapStream[0].calculationPeriodDates);
            var            years       = adjustableTerminationDate.unadjustedDate.Value.Year - adjustableEffectiveDate.unadjustedDate.Value.Year;
            var            calculation = (Calculation)swap.swapStream[0].calculationPeriodAmount.Item;
            var            notional    = XsdClassesFieldResolver.CalculationGetNotionalSchedule(calculation);
            var            currency    = notional.notionalStepSchedule.currency.Value;

            return(PricingStructureTypeEnum.RateVolatilityMatrix + "." + currency + "-IRSwap-" + years + "Y");
        }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public List <DateTime> GetListTermDates()
 {
     return(point.Select(eachPoint => XsdClassesFieldResolver.TimeDimensionGetDate(eachPoint.term)).ToList());
 }