/// <summary> /// Gets the discount factor. /// </summary> /// <param name="discountFactorCurve">The discount factor curve.</param> /// <param name="targetDate">The target date.</param> /// <param name="valuationDate">The valuation date.</param> /// <returns></returns> public double GetDiscountFactor(IRateCurve discountFactorCurve, DateTime targetDate, DateTime valuationDate) { IPoint point = new DateTimePoint1D(valuationDate, targetDate); var discountFactor = discountFactorCurve.Value(point); return(discountFactor); }
/// <summary> /// Gets the discount factor. /// </summary> /// <param name="dfCurve">The discount factor curve.</param> /// <param name="targetDate">The target date.</param> /// <param name="valuationDate">The valuation date.</param> /// <returns></returns> public decimal GetDiscountFactor(IRateCurve dfCurve, DateTime targetDate, DateTime valuationDate) { var point = new DateTimePoint1D(valuationDate, targetDate); var discountFactor = (decimal)dfCurve.Value(point); return(discountFactor); }
/// <summary> /// Gets the discount factor. /// </summary> /// <param name="discountFactorCurve">The discount factor curve.</param> /// <param name="targetDate">The target date.</param> /// <param name="valuationDate">The valuation date.</param> /// <returns></returns> public Decimal GetDiscountFactor(DateTime targetDate, DateTime valuationDate, IRateCurve discountFactorCurve) { IPoint point = new DateTimePoint1D(valuationDate, targetDate); var discountFactor = discountFactorCurve.Value(point); return((Decimal)discountFactor); }
/// <summary> /// Gets the discount factor. /// </summary> /// <param name="discountFactorCurve">The discount factor curve.</param> /// <param name="targetDate">The target date.</param> /// <param name="valuationDate">The valuation date.</param> /// <returns></returns> protected decimal GetIndex(IRateCurve discountFactorCurve, DateTime targetDate, DateTime valuationDate) { if (targetDate == valuationDate) { return(1.0m); } IPoint point = new DateTimePoint1D(valuationDate, targetDate); var discountFactor = (decimal)discountFactorCurve.Value(point); return(discountFactor); }