public virtual void test_forwardFxRateSpotSensitivity()
        {
            double computed = PRICER.forwardFxRateSpotSensitivity(FWD, PROVIDER);
            double df1      = PROVIDER.discountFactor(USD, PAYMENT_DATE);
            double df2      = PROVIDER.discountFactor(KRW, PAYMENT_DATE);

            assertEquals(computed, df1 / df2);
        }
 public virtual void test_forwardFxRateSpotSensitivity()
 {
     assertEquals(TRADE_PRICER.forwardFxRateSpotSensitivity(TRADE, PROVIDER), PRODUCT_PRICER.forwardFxRateSpotSensitivity(PRODUCT, PROVIDER));
 }
Beispiel #3
0
 /// <summary>
 /// Calculates the sensitivity of the forward exchange rate to the spot rate.
 /// <para>
 /// The returned value is based on the direction of the FX product.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the sensitivity to spot </returns>
 public virtual double forwardFxRateSpotSensitivity(ResolvedFxSingleTrade trade, RatesProvider provider)
 {
     return(productPricer.forwardFxRateSpotSensitivity(trade.Product, provider));
 }