Package org.jquantlib.instruments

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


                                        // perturb date and get theta
                                        final Date yesterday = today.sub(1);
                                        final Date tomorrow = today.add(1);
                                        /* @Time */final double dT = dc.yearFraction(yesterday, tomorrow);
                                        new Settings().setEvaluationDate(yesterday);
                                        value_m = option.NPV();
                                        new Settings().setEvaluationDate(tomorrow);
                                        value_p = option.NPV();
                                        expected.put("theta", (value_p - value_m) / dT);
                                        new Settings().setEvaluationDate(today);
                                        // compare
View Full Code Here


                                        final Date tomorrow = today.add(1);
                                        /* @Time */final double dT = dc.yearFraction(yesterday, tomorrow);
                                        new Settings().setEvaluationDate(yesterday);
                                        value_m = option.NPV();
                                        new Settings().setEvaluationDate(tomorrow);
                                        value_p = option.NPV();
                                        expected.put("theta", (value_p - value_m) / dT);
                                        new Settings().setEvaluationDate(today);
                                        // compare
                                        for (final Entry<String, Double> greek : calculated.entrySet()) {
                                            /* @Real */final double expct = expected.get(greek.getKey());
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.