public void FuturesArrearsConvexityAdjustment() { for (var i = 0; i < 10; i++) { var rate = (decimal)(50 + i); var cvt = FuturesAnalytics.FuturesArrearsConvexityAdjustment(rate / 1000, 0.25, 3.0, .2); var result = FuturesAnalytics.FuturesImpliedQuoteWithArrears(rate / 1000 - cvt, 0.25, 3.0, .2); Debug.WriteLine(String.Format("rate : {0} convexity: {1} implied: {2}", rate / 1000, cvt * 10000, result)); } decimal actual = FuturesAnalytics.FuturesArrearsConvexityAdjustment(0.055m, 0.25, 3d, 0.2); Assert.AreEqual(9.47863772776E-05, (double)actual, 0.000000001); actual = FuturesAnalytics.FuturesArrearsConvexityAdjustment(0.055m, 0.25, 0, 0.2); Assert.AreEqual(0, actual); }
/// <summary> /// Evaluates the futures arrears convexity adjustment. /// </summary> /// <param name="rate"></param> /// <param name="yearFraction"></param> /// <param name="timeToExpiry"></param> /// <param name="volatility"></param> /// <returns></returns> public decimal FuturesArrearsConvexityAdjustment(decimal rate, double yearFraction, double timeToExpiry, double volatility) { return(FuturesAnalytics.FuturesArrearsConvexityAdjustment(rate, yearFraction, timeToExpiry, volatility)); }