示例#1
0
        /// <summary>
        /// Computes the shifted quarterly cash forward rate for a specific future time.
        /// </summary>
        /// <param name="forwardDate"></param>
        /// <param name="discount">Discount factors used.</param>
        /// <param name="shift">Shifts used.</param>
        /// <returns></returns>
        public static double ShiftedCashForwardRate(int forwardDate, QuarterlyDiscounts discount, QuarterlyShifts shift)
        {
            double rate = 4 * (discount.Get(forwardDate) / discount.Get(forwardDate + 1) - 1);

            rate += shift.Get(forwardDate);
            return(rate);
        }
示例#2
0
        /// <summary>
        /// Computes the quarterly cash forward rate for a specific future time.
        /// </summary>
        /// <param name="forwardDate"></param>
        /// <param name="discount">Discount factors used.</param>
        /// <returns></returns>
        public static double CashForwardRate(int forwardDate, QuarterlyDiscounts discount)
        {
            double rate = 4 * (discount.Get(forwardDate) / discount.Get(forwardDate + 1) - 1);

            return(rate);
        }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="paymentDate">Contract payment time, in quarters.</param>
 /// <param name="settleDate">Delivery time, in quarters.</param>
 /// <param name="discount">Discount factors used.</param>
 /// <returns></returns>
 public static double ForwardContract(int paymentDate, int settleDate, QuarterlyDiscounts discount)
 {
     return(discount.Get(settleDate) / discount.Get(paymentDate));
 }