Examples of yield()


Examples of org.jquantlib.instruments.bonds.FixedRateBond.yield()

                     + "\n    expected:   " + cachedPrice2b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (price-cachedPrice2b));
      }

      yield = bond2.yield(marketPrice2, bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(yield-cachedYield2a) > tolerance) {
        fail("failed to reproduce cached compounded yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2a
                     + "\n    tolerance:  " + tolerance
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FixedRateBond.yield()

                     + "\n    expected:   " + cachedYield2a
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield2a));
      }

      yield = bond2.yield(marketPrice2, bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield2b) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2b
                     + "\n    tolerance:  " + tolerance
View Full Code Here

Examples of org.jquantlib.instruments.bonds.FixedRateBond.yield()

                     + "\n    expected:   " + cachedYield2b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield2b));
      }

      yield = bond2.yield(bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield2c) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2c
                     + "\n    tolerance:  " + tolerance
View Full Code Here

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

          + " " + floatingRateBond.nextCoupon()
            );
        System.out.println( "Yield           "
          + " " + zeroCouponBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
          + " " + fixedRateBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
          + " " + floatingRateBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
            );

         // Other computations
        System.out.println("Sample indirect computations (for the floating rate bond): " );
        System.out.println( "Yield to Clean Price: " +
View Full Code Here

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

            );

         // 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.yield()

        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.ZeroCouponBond.yield()

          + " " + "N/A"  //zeroCouponBond
          + " " + fixedRateBond.nextCoupon()
          + " " + floatingRateBond.nextCoupon()
            );
        System.out.println( "Yield           "
          + " " + zeroCouponBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
          + " " + fixedRateBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
          + " " + floatingRateBond.yield(new Actual360(),Compounding.Compounded, Frequency.Annual)
            );

         // Other computations
View Full Code Here

Examples of org.jruby.runtime.Block.yield()

        context.preScopedBody(DynamicScope.newDynamicScope(staticScope, context.getCurrentScope()));
       
        Block block = CompiledBlock.newCompiledClosure(context, self, Arity.createArity(0), staticScope, callback, false, BlockBody.ZERO_ARGS);
       
        try {
            block.yield(context, null);
        } finally {
            context.postScopedBody();
        }
       
        return context.getRuntime().getNil();
View Full Code Here

Examples of org.jruby.runtime.Block.yield()

        // FIXME: I use a for block to implement END node because we need a proc which captures
        // its enclosing scope.   ForBlock now represents these node and should be renamed.
        Block block = InterpretedBlock.newInterpretedClosure(context, this, self);
       
        try {
            block.yield(context, null);
        } finally {
            context.postScopedBody();
        }

        return runtime.getNil();
View Full Code Here

Examples of org.jruby.runtime.Block.yield()

        context.preScopedBody(DynamicScope.newDynamicScope(staticScope, context.getCurrentScope()));
       
        Block block = CompiledBlock.newCompiledClosure(context, self, Arity.createArity(0), staticScope, callback, false, BlockBody.ZERO_ARGS);
       
        try {
            block.yield(context, null);
        } finally {
            context.postScopedBody();
        }
       
        return context.getRuntime().getNil();
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.