public virtual void test_parSpread()
        {
            double              spread = PRICER.parSpread(FWD, PROVIDER);
            ResolvedFxSingle    fwdSp  = ResolvedFxSingle.of(CurrencyAmount.of(USD, NOMINAL_USD), FxRate.of(USD, KRW, FX_RATE + spread), PAYMENT_DATE);
            MultiCurrencyAmount pv     = PRICER.presentValue(fwdSp, PROVIDER);

            assertEquals(pv.convertedTo(USD, PROVIDER).Amount, 0d, NOMINAL_USD * TOL);
        }
 public virtual void test_parSpread()
 {
     assertEquals(TRADE_PRICER.parSpread(TRADE, PROVIDER), PRODUCT_PRICER.parSpread(PRODUCT, PROVIDER));
 }
Example #3
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the par spread.
 /// <para>
 /// This is the spread that should be added to the FX points to have a zero value.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the spread </returns>
 public virtual double parSpread(ResolvedFxSingleTrade trade, RatesProvider provider)
 {
     return(productPricer.parSpread(trade.Product, provider));
 }