//-------------------------------------------------------------------------
        public virtual void test_parRateSensitivity()
        {
            PointSensitivities ptsTrade   = PRICER_TRADE.parRateSensitivity(RDEPOSIT_TRADE, IMM_PROV);
            PointSensitivities ptsProduct = PRICER_PRODUCT.parRateSensitivity(RDEPOSIT_PRODUCT, IMM_PROV);

            assertTrue(ptsTrade.equalWithTolerance(ptsProduct, TOLERANCE_PV_DELTA));
        }
예제 #2
0
        //-------------------------------------------------------------------------
        public virtual void test_parSpreadSensitivity_noFixing()
        {
            PointSensitivities             computedNoFix      = PRICER.parSpreadSensitivity(RDEPOSIT, IMM_PROV_NOFIX);
            CurrencyParameterSensitivities sensiComputedNoFix = IMM_PROV_NOFIX.parameterSensitivity(computedNoFix);
            CurrencyParameterSensitivities sensiExpected      = CAL_FD.sensitivity(IMM_PROV_NOFIX, (p) => CurrencyAmount.of(EUR, PRICER.parSpread(RDEPOSIT, (p))));

            assertTrue(sensiComputedNoFix.equalWithTolerance(sensiExpected, TOLERANCE_RATE_DELTA));
            // Par rate and par spread sensitivities are equal
            PointSensitivities             computedParRateNoFix      = PRICER.parRateSensitivity(RDEPOSIT, IMM_PROV_NOFIX);
            CurrencyParameterSensitivities sensiComputedParRateNoFix = IMM_PROV_NOFIX.parameterSensitivity(computedParRateNoFix);

            assertTrue(sensiComputedNoFix.equalWithTolerance(sensiComputedParRateNoFix, TOLERANCE_RATE_DELTA));
            PointSensitivities             computedFix      = PRICER.parSpreadSensitivity(RDEPOSIT, IMM_PROV_FIX);
            CurrencyParameterSensitivities sensiComputedFix = IMM_PROV_NOFIX.parameterSensitivity(computedFix);

            assertTrue(sensiComputedFix.equalWithTolerance(sensiExpected, TOLERANCE_RATE_DELTA));
        }
 /// <summary>
 /// Calculates the deposit fair rate sensitivity to the curves.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the par rate curve sensitivity </returns>
 public virtual PointSensitivities parRateSensitivity(ResolvedIborFixingDepositTrade trade, RatesProvider provider)
 {
     return(productPricer.parRateSensitivity(trade.Product, provider));
 }