// Checks that the NDF forward rate is coherent with the standard FX forward present value.
        public virtual void test_forwardRateVsForex()
        {
            FxRate fwdNDF = PRICER.forwardFxRate(NDF, PROVIDER);
            FxRate fwdFX  = PRICER_FX.forwardFxRate(FOREX, PROVIDER);

            assertEquals(fwdNDF.fxRate(fwdNDF.Pair), fwdFX.fxRate(fwdFX.Pair), 1e-10);
        }
        public virtual void test_forwardFxRate()
        {
            // forward rate is computed by discounting for any RatesProvider input.
            FxRate computed = PRICER.forwardFxRate(FWD, PROVIDER);
            double df1      = PROVIDER.discountFactor(USD, PAYMENT_DATE);
            double df2      = PROVIDER.discountFactor(KRW, PAYMENT_DATE);
            double spot     = PROVIDER.fxRate(USD, KRW);
            FxRate expected = FxRate.of(USD, KRW, spot * df1 / df2);

            assertEquals(computed, expected);
        }
 public virtual void test_forwardFxRate()
 {
     assertEquals(TRADE_PRICER.forwardFxRate(TRADE, PROVIDER), PRODUCT_PRICER.forwardFxRate(PRODUCT, PROVIDER));
 }
示例#4
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the forward exchange rate.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the forward rate </returns>
 public virtual FxRate forwardFxRate(ResolvedFxSingleTrade trade, RatesProvider provider)
 {
     return(productPricer.forwardFxRate(trade.Product, provider));
 }