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

            if (future.currency != null && future.exchangeId != null)
            {
                var items = future.id.Split('-');
                if (items.Length > 2)
                {
                    var exchangeTradeCurve = CurveNameHelpers.GetExchangeTradedCurveName(future.currency.Value,
                                                                                         future.exchangeId.Value, items[2]);
                    result.Add(exchangeTradeCurve);
                }
            }
            if (future.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(future.currency.Value, true);
                result.Add(discountCurve);
                if (unitPrice.currency != null && unitPrice.currency.Value != future.currency.Value)
                {
                    var discountCurve2 = CurveNameHelpers.GetDiscountCurveName(unitPrice.currency, true);
                    result.Add(discountCurve2);
                }
            }
            return(result);
        }
示例#2
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public override List <String> GetRequiredPricingStructures()//TODO Need to add the case of floaters where there is a forecast curve.
        {
            var result = new List <String>();

            if (bond?.Item is string && bond.currency != null)
            {
                var tempId = bond.id.Split('-');
                var bondId = tempId[0];
                if (tempId.Length > 2)
                {
                    bondId = tempId[2];
                }
                var bondCurve = CurveNameHelpers.GetBondCurveName(bond.currency.Value, bondId);
                result.Add(bondCurve);
            }
            if (bond?.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(bond.currency.Value, true);
                result.Add(discountCurve);
                if (notionalAmount.currency != null && notionalAmount.currency.Value != bond.currency.Value)
                {
                    var discountCurve2 = CurveNameHelpers.GetDiscountCurveName(notionalAmount.currency, true);
                    result.Add(discountCurve2);
                }
            }
            return(result);
        }
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public override List <String> GetRequiredPricingStructures()
        {
            var result = new List <String>();

            if (property?.location != null && property.currency != null)
            {
                var tempId = property.id.Split('-');
                var bondId = tempId[0];
                if (tempId.Length > 2)
                {
                    bondId = tempId[2];
                }
                var bondCurve = CurveNameHelpers.GetPropertyCurveName(property.currency.Value, bondId);
                result.Add(bondCurve);
            }
            if (property?.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(property.currency.Value, true);
                result.Add(discountCurve);
                if (notionalAmount.currency != null && notionalAmount.currency.Value != property.currency.Value)
                {
                    var discountCurve2 = CurveNameHelpers.GetDiscountCurveName(notionalAmount.currency, true);
                    result.Add(discountCurve2);
                }
            }
            return(result);
        }
        /// <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);
        }
示例#5
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <String> GetRequiredVolatilitySurfaces()
        {
            var result = new List <String> {
                CurveNameHelpers.GetRateVolatilityMatrixName(this)
            };

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

            if (currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(currency, true);
                result.Add(discountCurve);
            }
            return(result);
        }
示例#7
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <String> GetRequiredPricingStructures()
        {
            var result = new List <String>();

            if (presentValuePrincipalExchangeAmount.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(presentValuePrincipalExchangeAmount.currency, true);
                result.Add(discountCurve);
            }
            return(result);
        }
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <string> GetRequiredVolatilitySurfaces()
        {
            var result = new List <String>();

            if (calculationPeriodAmount.Item is Calculation amount)
            {
                if (amount.Items[0] is FloatingRateCalculation floatingRateCalculation)
                {
                    result.Add(CurveNameHelpers.GetRateVolatilityMatrixName(floatingRateCalculation.floatingRateIndex, floatingRateCalculation.indexTenor));
                }
            }
            return(result);
        }
示例#9
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);
        }
示例#10
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <String> GetRequiredPricingStructures()
        {
            var result = new List <String>();

            if (forecastPaymentAmount != null)
            {
                var currency      = forecastPaymentAmount.currency;
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(currency, true);
                result.Add(discountCurve);
            }
            if (Items != null)
            {
                result.AddRange(Items.Select(calculationPeriod => ((CalculationPeriod)calculationPeriod).forecastAmount).Select(forecastAmount => CurveNameHelpers.GetDiscountCurveName(forecastAmount.currency, true)));
            }
            return(result);
        }
示例#11
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public List <String> GetRequiredVolatilitySurfaces()
        {
            var result     = new List <String>();
            var quoteBasis = strike.strikeQuoteBasis == StrikeQuoteBasisEnum.CallCurrencyPerPutCurrency ? QuoteBasisEnum.Currency2PerCurrency1 : QuoteBasisEnum.Currency1PerCurrency2;
            var fxRate     = new FxRate
            {
                quotedCurrencyPair =
                    new QuotedCurrencyPair
                {
                    currency1  = putCurrencyAmount.currency,
                    currency2  = callCurrencyAmount.currency,
                    quoteBasis = quoteBasis
                }
            };

            //THe other values are not necessary for the volatility curve definition.
            result.Add(CurveNameHelpers.GetFxVolatilityMatrixName(fxRate, "FxSpot"));
            return(result);
        }
示例#12
0
        /// <summary>
        /// Gets and sets the required pricing structures to value this leg.
        /// </summary>
        public override List <string> GetRequiredPricingStructures()//TODO Need to add the case of floaters where there is a forecast curve.
        {
            var result = new List <string>();

            if (equity.currency != null)
            {
                var bondCurve = CurveNameHelpers.GetEquityCurveName(equity.currency.Value,
                                                                    equity.id);
                result.Add(bondCurve);
            }
            if (equity.currency != null)
            {
                var discountCurve = CurveNameHelpers.GetDiscountCurveName(equity.currency.Value, true);
                result.Add(discountCurve);
                if (unitPrice.currency != null && unitPrice.currency.Value != equity.currency.Value)
                {
                    var discountCurve2 = CurveNameHelpers.GetDiscountCurveName(unitPrice.currency, true);
                    result.Add(discountCurve2);
                }
            }
            return(result);
        }