//-------------------------------------------------------------------------
        public virtual void test_currencyExposure()
        {
            MultiCurrencyAmount computed = PRICER.currencyExposure(FWD, PROVIDER);
            MultiCurrencyAmount expected = PRICER.presentValue(FWD, PROVIDER);

            assertEquals(computed, expected);
        }
        // Checks that the NDF currency exposure is coherent with the standard FX forward present value.
        public virtual void test_currencyExposureVsForex()
        {
            MultiCurrencyAmount pvNDF = PRICER.currencyExposure(NDF, PROVIDER);
            MultiCurrencyAmount pvFX  = PRICER_FX.currencyExposure(FOREX, PROVIDER);

            assertEquals(pvNDF.getAmount(USD).Amount, pvFX.getAmount(USD).Amount, NOMINAL_USD * TOL);
            assertEquals(pvNDF.getAmount(KRW).Amount, pvFX.getAmount(KRW).Amount, NOMINAL_USD * TOL * FX_MATRIX.fxRate(USD, KRW));
        }
 public virtual void test_currencyExposure()
 {
     assertEquals(TRADE_PRICER.currencyExposure(TRADE, PROVIDER), PRODUCT_PRICER.currencyExposure(PRODUCT, PROVIDER));
 }
Esempio n. 4
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the currency exposure by discounting each payment in its own currency.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the currency exposure </returns>
 public virtual MultiCurrencyAmount currencyExposure(ResolvedFxSingleTrade trade, RatesProvider provider)
 {
     return(productPricer.currencyExposure(trade.Product, provider));
 }