Exemple #1
0
        //-------------------------------------------------------------------------
        public virtual void test_parRate()
        {
            double psTrade   = PRICER_TRADE.parRate(RDEPOSIT_TRADE, IMM_PROV);
            double psProduct = PRICER_PRODUCT.parRate(RDEPOSIT_PRODUCT, IMM_PROV);

            assertEquals(psTrade, psProduct, TOLERANCE_RATE);
        }
Exemple #2
0
        public virtual void test_parRate()
        {
            SimpleRatesProvider prov = provider(VAL_DATE, DF_START, DF_END);
            double      parRate      = PRICER.parRate(RTERM_DEPOSIT, prov);
            TermDeposit depositPar   = TermDeposit.builder().buySell(BuySell.BUY).startDate(START_DATE).endDate(END_DATE).businessDayAdjustment(BD_ADJ).dayCount(ACT_360).notional(NOTIONAL).currency(EUR).rate(parRate).build();
            double      pvPar        = PRICER.presentValue(depositPar.resolve(REF_DATA), prov).Amount;

            assertEquals(pvPar, 0.0, NOTIONAL * TOLERANCE);
        }
Exemple #3
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the deposit fair rate given the start and end time and the accrual factor.
 /// <para>
 /// When the deposit has already started the number may not be meaningful as the remaining period
 /// is not in line with the accrual factor.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the par rate </returns>
 public virtual double parRate(ResolvedTermDepositTrade trade, RatesProvider provider)
 {
     return(productPricer.parRate(trade.Product, provider));
 }