Package org.jquantlib.daycounters

Examples of org.jquantlib.daycounters.Actual360.yearFraction()


                                            expected.put("vega",(value_p - value_m)/(2*dv));

                                            // perturb date and get theta
                                            final Date yesterday = today.sub(1);
                                            final Date tomorrow  = today.add(1);
                                            final double dT = dc.yearFraction(yesterday, tomorrow);
                                            new Settings().setEvaluationDate(yesterday);
                                            value_m = option.NPV();
                                            new Settings().setEvaluationDate(tomorrow);
                                            value_p = option.NPV();
                                            new Settings().setEvaluationDate(Date.todaysDate());
View Full Code Here


                                    value_m = option.NPV();
                                    vol.setValue(v);
                                    expected.put("vega", (value_p - value_m)/(2*dv) );

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

                                                        vol.setValue(v);
                                                        expected.put("vega", (value_p - value_m) / (2 * dv));

                                                        final Date yesterday = today.sub(1);
                                                        final Date tomorrow = today.add(1);
                                                        final double dT = dc.yearFraction(yesterday, tomorrow);
                                                        new Settings().setEvaluationDate(yesterday);
                                                        value_m = option.NPV();
                                                        new Settings().setEvaluationDate(tomorrow);
                                                        value_p = option.NPV();
                                                        new Settings().setEvaluationDate(today);
View Full Code Here

                                            expected.put("vega",(value_p - value_m)/(2*dv));

                                            // perturb date and get theta
                                            final Date yesterday = today.sub(1);
                                            final Date tomorrow  = today.add(1);
                                            final double dT = dc.yearFraction(yesterday, tomorrow);
                                            new Settings().setEvaluationDate(yesterday);
                                            value_m = option.NPV();
                                            new Settings().setEvaluationDate(tomorrow);
                                            value_p = option.NPV();
                                            new Settings().setEvaluationDate(Date.todaysDate());
View Full Code Here

                                        expected.put("vega", (value_p - value_m) / (2 * dv));

                                        // perturb date and get theta
                                        final Date yesterday = today.sub(1);
                                        final Date tomorrow = today.add(1);
                                        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);
View Full Code Here

                                        expected.put("vega", (value_p - value_m) / (2 * dv));

                                        // 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);
View Full Code Here

        Date exercise = today.clone();
        exercise = exercise.add(new Period(2,TimeUnit.Years));


        final double residualTime = dc.yearFraction(today, exercise);

        final SimpleQuote spot = new SimpleQuote(0.0);
        final YieldTermStructure qTS = Utilities.flatRate(today, q, dc);
        final YieldTermStructure rTS = Utilities.flatRate(today, r, dc);
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.