Example #1
0
 /// <summary>
 /// Gets the year fraction to maturity.
 /// </summary>
 /// <returns></returns>
 protected decimal GetTimeToExpiry(DateTime baseDate, DateTime expiryDate)
 {
     return((decimal)DayCounterHelper.ToDayCounter(DayCountFractionEnum.ACT_365_FIXED).YearFraction(baseDate, expiryDate));
 }
Example #2
0
        ///<summary>
        ///</summary>
        ///<param name="baseDate"></param>
        ///<param name="expirationAsDate"></param>
        ///<param name="maturityYearFraction"></param>
        ///<param name="strike"></param>
        ///<returns></returns>
        public double GetValue(DateTime baseDate, DateTime expirationAsDate, double maturityYearFraction, decimal strike)
        {
            double expiryYearFraction = DayCounterHelper.ToDayCounter(DayCountFractionEnum.ACT_365_FIXED).YearFraction(baseDate, expirationAsDate);

            return(Value(expiryYearFraction, maturityYearFraction, (double)strike));
        }
 /// <summary>
 /// Gets the year fraction to maturity.
 /// </summary>
 /// <returns></returns>
 public decimal GetTimeToMaturity(DateTime baseDate, DateTime maturityDate)
 {
     return((decimal)DayCounterHelper.ToDayCounter(DayCountFractionEnum.ACT_365_FIXED)
            .YearFraction(baseDate, maturityDate));
 }