public virtual void test_priceSensitivity() { PointSensitivities point = PRICER.priceSensitivity(FUTURE, PROVIDER); CurrencyParameterSensitivities computed = PROVIDER.parameterSensitivity(point); CurrencyParameterSensitivities expected = FD_CAL.sensitivity(PROVIDER, (p) => CurrencyAmount.of(USD, PRICER.price(FUTURE, (p)))); assertTrue(computed.equalWithTolerance(expected, 10d * EPS)); }
//------------------------------------------------------------------------- /// <summary> /// Calculates the price sensitivity of the deliverable swap futures product. /// <para> /// The price sensitivity of the product is the sensitivity of the price to the underlying curves. /// /// </para> /// </summary> /// <param name="trade"> the trade </param> /// <param name="ratesProvider"> the rates provider </param> /// <returns> the price curve sensitivity of the trade </returns> public virtual PointSensitivities priceSensitivity(ResolvedDsfTrade trade, RatesProvider ratesProvider) { return(productPricer.priceSensitivity(trade.Product, ratesProvider)); }