예제 #1
0
        ///<summary>
        /// Converts a discount factor to a compounding zero rate.
        ///</summary>
        ///<param name="yearFraction">The year Fraction.</param>
        ///<param name="discountFactor">The discount factor.</param>
        ///<param name="frequency">The compounding frequency. Can take: Continuous, Daily, Quarterly,
        /// Semi-Annual,SemiAnnual,Semi and Annual</param>
        ///<returns>The compounded zero rate requested.</returns>
        public static double DiscountFactorToZeroRate(double discountFactor, double yearFraction, string frequency)
        {
            var    compounding = EnumParse.ToCompoundingFrequencyEnum(frequency);
            double result      = DiscountFactorToZeroRate(discountFactor, yearFraction, compounding);

            return(result);
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public CompoundingFrequencyEnum ToEnum()
 {
     return(EnumParse.ToCompoundingFrequencyEnum(Value));
 }
예제 #3
0
 /// <summary>
 /// Anns the yield.
 /// </summary>
 /// <param name="baseDate">The base date.</param>
 /// <param name="targetDate">The target date.</param>
 /// <param name="divCurve">The div curve.</param>
 /// <param name="ratetimes">The rate times.</param>
 /// <param name="rateamts">The rate amounts.</param>
 /// <param name="im">the im?</param>
 /// <param name="cf">The cf?</param>
 /// <returns></returns>
 public static double GetPVDivs(DateTime baseDate, DateTime targetDate, DiscreteCurve divCurve, double[] ratetimes, double[] rateamts, string im, string cf)
 {
     return(GetPVDivs(baseDate, targetDate, divCurve, ratetimes, rateamts, im,
                      EnumParse.ToCompoundingFrequencyEnum(cf)));
 }
예제 #4
0
 /// <summary>
 /// Converts from the zero rate to a terminal wealth.
 /// </summary>
 /// <param name="rate"></param>
 /// <param name="yearFraction"></param>
 /// <param name="compoundingFrequency"></param>
 /// <returns></returns>
 public static decimal TerminalWealthFromZeroRate(decimal rate, decimal yearFraction,
                                                  string compoundingFrequency)
 {
     return(TerminalWealthFromZeroRate(rate, yearFraction,
                                       EnumParse.ToCompoundingFrequencyEnum(compoundingFrequency)));
 }
예제 #5
0
 ///<summary>
 ///</summary>
 ///<param name="zeroRate"></param>
 ///<param name="yearFraction"></param>
 ///<param name="compoundingFrequency"></param>
 ///<returns></returns>
 ///<exception cref="NotImplementedException"></exception>
 public static double ZeroRateToDiscountFactor(double zeroRate, double yearFraction, string compoundingFrequency)
 {
     return(ZeroRateToDiscountFactor(zeroRate, yearFraction, EnumParse.ToCompoundingFrequencyEnum(compoundingFrequency)));
 }