Examples of NPV()


Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                    expected.clear();
                                    calculated.clear();

                                    final double refNPV = refOption.NPV();
                                    final double optNPV = option.NPV();

                                    expected.put("value", refNPV);
                                    calculated.put("value", optNPV);

                                    if (testGreeks && option.NPV() > spot.value() * 1.0e-5) {
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                    final double optNPV = option.NPV();

                                    expected.put("value", refNPV);
                                    calculated.put("value", optNPV);

                                    if (testGreeks && option.NPV() > spot.value() * 1.0e-5) {
                                        expected.put("delta", refOption.delta());
                                        expected.put("gamma", refOption.gamma());
                                        expected.put("theta", refOption.theta());
                                        calculated.put("delta", option.delta());
                                        calculated.put("gamma", option.gamma());
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                    expected.clear();
                                    calculated.clear();

                                    // FLOATING_POINT_EXCEPTION
                                    expected.put("value", refOption.NPV());
                                    calculated.put("value", option.NPV());

                                    if (option.NPV() > spot.value() * 1.0e-5) {
                                        expected.put("delta", refOption.delta());
                                        expected.put("gamma", refOption.gamma());
                                        expected.put("theta", refOption.theta());
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                    // FLOATING_POINT_EXCEPTION
                                    expected.put("value", refOption.NPV());
                                    calculated.put("value", option.NPV());

                                    if (option.NPV() > spot.value() * 1.0e-5) {
                                        expected.put("delta", refOption.delta());
                                        expected.put("gamma", refOption.gamma());
                                        expected.put("theta", refOption.theta());
                                        calculated.put("delta", option.delta());
                                        calculated.put("gamma", option.gamma());
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                qRate.setValue(q);
                                rRate.setValue(r);
                                vol.setValue(v);

                                /* @Real */ final double calculated = option.NPV();
                                /* @Real */ final double expected = ref_option.NPV();
                                /* @Real */ final double error = Math.abs(calculated-expected);
                                if (error > tolerance)
                                    REPORT_FAILURE("value start limit",
                                                   payoff, exercise,
                                                   u, q, r, today, v,
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                rRate.setValue(r);
                                vol.setValue(v);

                                /* @Real */ final double calculated = option.NPV();
                                spot.setValue(u-dividendValue);
                                /* @Real */ final double expected = ref_option.NPV();
                                /* @Real */ final double error = Math.abs(calculated-expected);
                                if (error > tolerance)
                                    REPORT_FAILURE("value", payoff, exercise,
                                                   u, q, r, today, v,
                                                   expected, calculated,
View Full Code Here

Examples of org.jquantlib.instruments.VanillaOption.NPV()

                                qRate.setValue(q);
                                rRate.setValue(r);
                                vol.setValue(v);

                                /* @Real */ final double calculated = option.NPV();
                                /* @Real */ final double expected = ref_option.NPV();
                                /* @Real */ final double error = Math.abs(calculated-expected);
                                if (error > tolerance)
                                    REPORT_FAILURE("value", payoff, exercise,
                                                   u, q, r, today, v,
                                                   expected, calculated,
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ConvertibleFixedCouponBond.NPV()

        method = "Jarrow-Rudd";
        engine = new BinomialConvertibleEngine<JarrowRudd>(JarrowRudd.class, stochasticProcess, timeSteps);
        europeanBond.setPricingEngine(engine);
        americanBond.setPricingEngine(engine);
        System.out.printf(fmt, method, europeanBond.NPV(), americanBond.NPV() );

        method = "Cox-Ross-Rubinstein";
        engine = new BinomialConvertibleEngine<CoxRossRubinstein>(CoxRossRubinstein.class, stochasticProcess, timeSteps);
        europeanBond.setPricingEngine(engine);
        americanBond.setPricingEngine(engine);
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ConvertibleFloatingRateBond.NPV()

          + "\n    calculated: " + euFloating.NPV()
          + "\n    expected:   " + floating.settlementValue()
          + "\n    error:      " + error);
    }

    error = Math.abs(amFloating.NPV() - floating.settlementValue());
    if (error > tolerance) {
      fail("failed to reproduce floating-rate bond price:"
          + "\n    calculated: " + amFloating.NPV()
          + "\n    expected:   " + floating.settlementValue()
          + "\n    error:      " + error);
View Full Code Here

Examples of org.jquantlib.instruments.bonds.ConvertibleZeroCouponBond.NPV()

          + "\n    calculated: " + euZero.NPV()
          + "\n    expected:   " + zero.settlementValue()
          + "\n    error:      " + error);
    }

    error = Math.abs(amZero.NPV() - zero.settlementValue());
    if (error > tolerance) {
      fail("failed to reproduce zero-coupon bond price:"
          + "\n    calculated: " + amZero.NPV()
          + "\n    expected:   " + zero.settlementValue()
          + "\n    error:      " + error);
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.