Examples of NPV()


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

                                rRate.setValue(r);
                                vol.setValue(v);
                                // FLOATING_POINT_EXCEPTION
                                /* @Real */ final double calculated = option.NPV();
                                if (calculated > spot.value()*1.0e-5) {
                                    /* @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.DividendVanillaOption.NPV()

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

                                // FLOATING_POINT_EXCEPTION
                                /* @Real */ final double value = option.NPV();
                                calculated.put("delta", option.delta() );
                                calculated.put("gamma", option.gamma() );
                                // calculated.put("theta", option.theta() );

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

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

                                if (value > spot.value()*1.0e-5) {
                                  // perturb spot and get delta and gamma
                                  /* @Real */ final double du = u*1.0e-4;
                                  spot.setValue(u+du);
                                  /* @Real */ final double value_p = option.NPV(),
                                       delta_p = option.delta();
                                  spot.setValue(u-du);
                                  /* @Real */ final double value_m = option.NPV(),
                                       delta_m = option.delta();
                                  spot.setValue(u);
View Full Code Here

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

                                  /* @Real */ final double du = u*1.0e-4;
                                  spot.setValue(u+du);
                                  /* @Real */ final double value_p = option.NPV(),
                                       delta_p = option.delta();
                                  spot.setValue(u-du);
                                  /* @Real */ final double value_m = option.NPV(),
                                       delta_m = option.delta();
                                  spot.setValue(u);
                                  expected.put("delta", (value_p - value_m)/(2*du) );
                                  expected.put("gamma", (delta_p - delta_m)/(2*du) );

View Full Code Here

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

        final DividendVanillaOption option1 = new DividendVanillaOption(payoff, exercise, dividendDates, dividends);
        option1.setPricingEngine(engine);

        // FLOATING_POINT_EXCEPTION
        final /* @Real */ double refValue = option1.NPV();

        for (/* @Size */ int i=0; i<=6; i++) {
            dividends.add(0.0);
            dividendDates.add(today.add(i));

View Full Code Here

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

            dividends.add(0.0);
            dividendDates.add(today.add(i));

            final DividendVanillaOption option = new DividendVanillaOption(payoff, exercise, dividendDates, dividends);
            option.setPricingEngine(engine);
            final /* @Real */ double value = option.NPV();

            if (Math.abs(refValue-value) > tolerance) {
                final StringBuilder sb = new StringBuilder();
                sb.append("NPV changed by null dividend :\n");
                sb.append("    previous value: ").append(refValue).append('\n');
View Full Code Here

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

            final PricingEngine engine = new AnalyticEuropeanEngine(stochProcess);

            final EuropeanOption option = new EuropeanOption(payoff, exercise);
            option.setPricingEngine(engine);

            final double calculated = option.NPV();
            final double error = Math.abs(calculated-values[i].result);
            final double tolerance = values[i].tol;

            final StringBuilder sb = new StringBuilder();
            sb.append("error ").append(error).append(" .gt. tolerance ").append(tolerance).append('\n');
View Full Code Here

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

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

                                        final double value = option.NPV();
                                        final double delta = option.delta();
                                        final double gamma = option.gamma();
                                        final double theta = option.theta();
                                        final double rho   = option.rho();
                                        final double drho  = option.dividendRho();
View Full Code Here

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

                                        if (value > spot.value()*1.0e-5) {
                                            // perturb spot and get delta and gamma
                                            final double du = u*1.0e-4;
                                            spot.setValue(u+du);
                                            double value_p = option.NPV();
                                            final double delta_p = option.delta();
                                            spot.setValue(u-du);

                                            double value_m = option.NPV();
                                            final double delta_m = option.delta();
View Full Code Here

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

                                            spot.setValue(u+du);
                                            double value_p = option.NPV();
                                            final double delta_p = option.delta();
                                            spot.setValue(u-du);

                                            double value_m = option.NPV();
                                            final double delta_m = option.delta();
                                            spot.setValue(u);
                                            expected.put("delta", (value_p - value_m)/(2*du));
                                            expected.put("gamma", (delta_p - delta_m)/(2*du));

 
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.