public virtual void test_presentValueSensitivityStrike()
        {
            double sensi1   = PRODUCT_PRICER.presentValueSensitivityStrike(CMS_ONE_LEG, RATES_PROVIDER, VOLATILITIES);
            double sensi2   = PRODUCT_PRICER.presentValueSensitivityStrike(CMS_TWO_LEGS, RATES_PROVIDER, VOLATILITIES);
            double sensiCms = CMS_LEG_PRICER.presentValueSensitivityStrike(CMS_LEG, RATES_PROVIDER, VOLATILITIES);

            assertEquals(sensi1, sensiCms);
            assertEquals(sensi2, sensiCms);
        }
        public virtual void test_presentValueSensitivityStrike()
        {
            double sensi1     = TRADE_PRICER.presentValueSensitivityStrike(CMS_TRADE_PREMIUM, RATES_PROVIDER, VOLATILITIES);
            double sensi2     = TRADE_PRICER.presentValueSensitivityStrike(CMS_TRADE, RATES_PROVIDER, VOLATILITIES);
            double sensiProd1 = PRODUCT_PRICER.presentValueSensitivityStrike(CMS_ONE_LEG, RATES_PROVIDER, VOLATILITIES);
            double sensiProd2 = PRODUCT_PRICER.presentValueSensitivityStrike(CMS_TWO_LEGS, RATES_PROVIDER, VOLATILITIES);

            assertEquals(sensi1, sensiProd1);
            assertEquals(sensi2, sensiProd2);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Calculates the present value sensitivity to the strike value.
 /// <para>
 /// The present value sensitivity of the trade is the sensitivity of the present value to the strike value.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the CMS trade </param>
 /// <param name="ratesProvider">  the rates provider </param>
 /// <param name="swaptionVolatilities">  the swaption volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual double presentValueSensitivityStrike(ResolvedCmsTrade trade, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities)
 {
     return(productPricer.presentValueSensitivityStrike(trade.Product, ratesProvider, swaptionVolatilities));
 }