Examples of cleanPrice()


Examples of org.jquantlib.instruments.bonds.FloatingRateBond.cleanPrice()

            );

         // Other computations
        System.out.println("Sample indirect computations (for the floating rate bond): " );
        System.out.println( "Yield to Clean Price: " +
            floatingRateBond.cleanPrice(floatingRateBond.yield(new Actual360(),Compounding.Compounded,Frequency.Annual),new Actual360(),Compounding.Compounded,Frequency.Annual,settlementDate)
        );
       
        System.out.println("Clean Price to Yield: " +
         floatingRateBond.yield(floatingRateBond.cleanPrice(),new Actual360(),Compounding.Compounded,Frequency.Annual,settlementDate)
        );
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FloatingRateBond.cleanPrice()

        System.out.println( "Yield to Clean Price: " +
            floatingRateBond.cleanPrice(floatingRateBond.yield(new Actual360(),Compounding.Compounded,Frequency.Annual),new Actual360(),Compounding.Compounded,Frequency.Annual,settlementDate)
        );
       
        System.out.println("Clean Price to Yield: " +
         floatingRateBond.yield(floatingRateBond.cleanPrice(),new Actual360(),Compounding.Compounded,Frequency.Annual,settlementDate)
        );
       
         /* "Yield to Price"
           "Price to Yield"
         */
 
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FloatingRateBond.cleanPrice()

      final boolean indexedCoupon = new Settings().isUseIndexedCoupon();
     
      final double cachedPrice1 = indexedCoupon ? 99.874645 : 99.874646;

      double price = bond1.cleanPrice();
      if (Math.abs(price-cachedPrice1) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice1 + "\n"
                     + "    error:      " + (price-cachedPrice1));
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FloatingRateBond.cleanPrice()

      PricerSetter.setCouponPricer(bond2.cashflows(),pricer);

        final double cachedPrice2 = indexedCoupon ? 97.955904 : 97.955904; // yes, they are the same, according to QuantLib/C++

      price = bond2.cleanPrice();
      if (Math.abs(price-cachedPrice2) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice2 + "\n"
                     + "    error:      " + (price-cachedPrice2));
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FloatingRateBond.cleanPrice()

      PricerSetter.setCouponPricer(bond3.cashflows(),pricer);

        final double cachedPrice3 = indexedCoupon ? 98.495458 : 98.495459;
       
      price = bond3.cleanPrice();
      if (Math.abs(price-cachedPrice3) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice3 + "\n"
                     + "    error:      " + (price-cachedPrice3));
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ZeroCouponBond.cleanPrice()

               "  " + zeroCouponBond.NPV()
               "  " + fixedRateBond.NPV()
               "  " + floatingRateBond.NPV());
               
        System.out.println("Clean Price      "
            + "  " +zeroCouponBond.cleanPrice()
            + "  " +fixedRateBond.cleanPrice()
            + "  " + floatingRateBond.cleanPrice()
            );
       
        System.out.println("Dirty price      "
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ZeroCouponBond.cleanPrice()

    final PricingEngine bondEngine = new DiscountingBondEngine(discountCurve);
      bond1.setPricingEngine(bondEngine);

      final double cachedPrice1 = 88.551726;

      double price = bond1.cleanPrice();
      if (Math.abs(price-cachedPrice1) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice1 + "\n"
                     + "    error:      " + (price-cachedPrice1));
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ZeroCouponBond.cleanPrice()

      bond2.setPricingEngine(bondEngine);

      final double cachedPrice2 = 91.278949;

      price = bond2.cleanPrice();
      if (Math.abs(price-cachedPrice2) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice2 + "\n"
                     + "    error:      " + (price-cachedPrice2));
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ZeroCouponBond.cleanPrice()

      bond3.setPricingEngine(bondEngine);

      final double cachedPrice3 = 94.098006;

      price = bond3.cleanPrice();
      if (Math.abs(price-cachedPrice3) > tolerance) {
          fail("failed to reproduce cached price:\n"
                     + "    calculated: " + price + "\n"
                     + "    expected:   " + cachedPrice3 + "\n"
                     + "    error:      " + (price-cachedPrice3));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.