예제 #1
0
        public virtual decimal GetCouponPerPeriod()
        {
            decimal couponFromRipper = (decimal)CouponAmountRipper.Get(ref _textToParse);

            if (CouponAmountRipper.CouponIsAnnualized)
            {
                // We assume that if the coupon is annualized, it is expressed as a percentage of par
                // (and not as a dollar amount).
                CouponFrequency = CouponFrequencyRipper.Get(ref _textToParse);
                int     monthsPerPeriod = CouponFrequency.ConvertToNumberOfMonths();
                decimal couponPerPeriod = couponFromRipper / (12 / monthsPerPeriod);
                return(couponPerPeriod);
            }
            if (CouponAmountRipper.NumberRepresentsPercentageValue)
            {
                return(couponFromRipper);
            }
            // This condition assumes that because the coupon ripped was not expressed as a % of par
            // that the coupon amount was not annualized and is the actual coupon amount per period
            // in dollar terms.
            decimal par = (decimal)GetPar();
            decimal couponAsPercentageOfPar = couponFromRipper / par;

            return(couponAsPercentageOfPar);
        }
예제 #2
0
 public virtual string GetCouponFrequency()
 {
     if (CouponFrequency == null)
     {
         CouponFrequency = CouponFrequencyRipper.Get(ref _textToParse);
         return(CouponFrequency);
     }
     else
     {
         return(CouponFrequency);
     }
 }