Example #1
0
        //-------------------------------------------------------------------------
        public virtual void test_parRate()
        {
            double            parRate  = PRICER.parRate(RDEPOSIT, IMM_PROV_NOFIX);
            IborFixingDeposit deposit0 = DEPOSIT.toBuilder().fixedRate(parRate).build();
            CurrencyAmount    pv0      = PRICER.presentValue(deposit0.resolve(REF_DATA), IMM_PROV_NOFIX);

            assertEquals(pv0.Amount, 0, TOLERANCE_RATE);
            double parRate2 = PRICER.parRate(RDEPOSIT, IMM_PROV_NOFIX);

            assertEquals(parRate, parRate2, TOLERANCE_RATE);
        }
        //-------------------------------------------------------------------------
        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);
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Calculates the deposit fair rate given the start and end time and the accrual factor.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="provider">  the rates provider </param>
 /// <returns> the par rate </returns>
 public virtual double parRate(ResolvedIborFixingDepositTrade trade, RatesProvider provider)
 {
     return(productPricer.parRate(trade.Product, provider));
 }