コード例 #1
0
 // -------------------------------------------------------------------------
 public void test_price() {
   double computed = FUTURE_PRICER.price(FUTURE_PRODUCT, PROVIDER);
   double dirtyPrice =
       BOND_PRICER.dirtyPriceFromCurves(BOND, PROVIDER, FUTURE_PRODUCT.getLastDeliveryDate());
   double expected =
       BOND_PRICER.cleanPriceFromDirtyPrice(BOND, FUTURE_PRODUCT.getLastDeliveryDate(), dirtyPrice)
           / CONVERSION_FACTOR[0];
   assertEquals(computed, expected, TOL);
 }
コード例 #2
0
 public void test_priceWithZSpread_continuous() {
   double computed =
       FUTURE_PRICER.priceWithZSpread(FUTURE_PRODUCT, PROVIDER, Z_SPREAD, CONTINUOUS, 0);
   double dirtyPrice =
       BOND_PRICER.dirtyPriceFromCurvesWithZSpread(
           BOND, PROVIDER, Z_SPREAD, CONTINUOUS, 0, FUTURE_PRODUCT.getLastDeliveryDate());
   double expected =
       BOND_PRICER.cleanPriceFromDirtyPrice(BOND, FUTURE_PRODUCT.getLastDeliveryDate(), dirtyPrice)
           / CONVERSION_FACTOR[0];
   assertEquals(computed, expected, TOL);
 }
コード例 #3
0
 public void test_priceWithZSpread_periodic() {
   double computed =
       FUTURE_PRICER.priceWithZSpread(
           FUTURE_PRODUCT, PROVIDER, Z_SPREAD, PERIODIC, PERIOD_PER_YEAR);
   double dirtyPrice =
       BOND_PRICER.dirtyPriceFromCurvesWithZSpread(
           BOND,
           PROVIDER,
           Z_SPREAD,
           PERIODIC,
           PERIOD_PER_YEAR,
           FUTURE_PRODUCT.getLastDeliveryDate());
   double expected =
       BOND_PRICER.cleanPriceFromDirtyPrice(BOND, FUTURE_PRODUCT.getLastDeliveryDate(), dirtyPrice)
           / CONVERSION_FACTOR[0];
   assertEquals(computed, expected, TOL);
 }