Пример #1
0
        /// <summary>
        /// Prepare for valuation anything that is dependent upon the scenario.
        /// </summary>
        public override void PreValue(PriceFactorList factors)
        {
            base.PreValue(factors);

            CFListBaseDeal <TCashflowList> deal = (CFListBaseDeal <TCashflowList>)fDeal;

            if (string.IsNullOrEmpty(fDeal.GetIssuer()))
            {
                return;
            }

            if (UseSurvivalProbability())
            {
                fSurvivalProb = factors.GetInterface <ISurvivalProb>(string.IsNullOrEmpty(deal.GetSurvivalProbability()) ? deal.GetIssuer() : deal.GetSurvivalProbability());
            }

            if (RespectDefault())
            {
                fRecoveryRate = factors.Get <RecoveryRate>(InterestRateUtils.GetRateId(deal.GetRecoveryRate(), deal.GetIssuer()));
                fCreditRating = factors.Get <CreditRating>(deal.GetIssuer());
            }
        }
Пример #2
0
        /// <summary>
        /// Register price factors.
        /// </summary>
        public override void RegisterFactors(PriceFactorList factors, ErrorList errors)
        {
            base.RegisterFactors(factors, errors);

            CFListBaseDeal <TCashflowList> deal = (CFListBaseDeal <TCashflowList>)fDeal;

            if (string.IsNullOrEmpty(fDeal.GetIssuer()))
            {
                return;
            }

            if (UseSurvivalProbability())
            {
                factors.RegisterInterface <ISurvivalProb>(string.IsNullOrEmpty(deal.GetSurvivalProbability()) ? deal.GetIssuer() : deal.GetSurvivalProbability());
            }

            if (RespectDefault())
            {
                factors.Register <RecoveryRate>(InterestRateUtils.GetRateId(deal.GetRecoveryRate(), deal.GetIssuer()));
                factors.Register <CreditRating>(deal.GetIssuer());
            }

            fSettlementOffsetHelper.ValidateHolidayCalendars(factors.CalendarData, errors);
        }
Пример #3
0
        /// <summary>
        /// Returns true when the valuation is required on all cashflow dates.
        /// </summary>
        /// <remarks>
        /// When true, the cashflows are calculated in the loop over time grid points.
        /// When false, the cashflows are calculated by CollectCashflows.
        /// </remarks>
        protected virtual bool ValueOnCashflowDates()
        {
            CFListBaseDeal <TCashflowList> deal = (CFListBaseDeal <TCashflowList>)fDeal;

            return(deal.IsCashSettled() || RespectDefault() && !string.IsNullOrEmpty(deal.GetIssuer()));
        }