Examples of discount()


Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Date today = new Settings().evaluationDate();

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = today.add(days[i]);
            expected[i] = localTermStructure.discount(anotherDay);
        }

        final Date nextMonth = today.add(30);
        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = nextMonth.add(days[i]);
            calculated[i] = localTermStructure.discount(anotherDay);
        }

        for (int i=0; i<days.length; i++) {
            if (!Closeness.isClose(expected[i],calculated[i])) {
                fail("\n  Discount at " + days[i] + " days:\n"
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Quote u = underlying_.currentLink();
        final YieldTermStructure dTS = dividendTS_.currentLink();
        final YieldTermStructure rTS = riskFreeTS_.currentLink();
        final BlackVolTermStructure bTS = blackTS_.currentLink();

        final double forwardValue = u.value() * ( dTS.discount(time, true) / rTS.discount(time, true) );

        // strike derivatives
        /*@Real*/ double strike;
        /*@Real*/ double strikem;
        /*@Real*/ double strikep;
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Quote u = underlying_.currentLink();
        final YieldTermStructure dTS = dividendTS_.currentLink();
        final YieldTermStructure rTS = riskFreeTS_.currentLink();
        final BlackVolTermStructure bTS = blackTS_.currentLink();

        final double forwardValue = u.value() * ( dTS.discount(time, true) / rTS.discount(time, true) );

        // strike derivatives
        /*@Real*/ double strike;
        /*@Real*/ double strikem;
        /*@Real*/ double strikep;
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Date date40 = today.clone().addAssign(40);
        final Date date50 = today.clone().addAssign(50);


        //Calculating discount factor
        System.out.println("The discount factor for the date 30 days from today is = "+flatforward.discount(date30.clone()));

        //Calculating forward rate
        System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+flatforward.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //Calculating parRate for the dates as shown below-
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Date today = new Settings().evaluationDate();

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = today.add(days[i]);
            expected[i] = localTermStructure.discount(anotherDay);
        }

        final Date nextMonth = today.add(30);
        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = nextMonth.add(days[i]);
            calculated[i] = localTermStructure.discount(anotherDay);
        }

        for (int i=0; i<days.length; i++) {
            if (!Closeness.isClose(expected[i],calculated[i])) {
                fail("\n  Discount at " + days[i] + " days:\n"
View Full Code Here

Examples of org.jquantlib.termstructures.YieldTermStructure.discount()

        final Date exerciseDate = today.clone().addAssign(360);
        final Exercise exercise = new EuropeanExercise(exerciseDate);

        QL.info("Exercise: " + exerciseDate);
        QL.info("Df: " + rTS.discount(exerciseDate));
        QL.info("DivDf: " + qTS.discount(exerciseDate));

        final List<Date> fixingDates = new ArrayList<Date>(futureFixings);
        final int dt = (int) (360.0 / (futureFixings) + 0.5);
        fixingDates.add(today.clone().addAssign(dt));
View Full Code Here

Examples of org.jquantlib.termstructures.yieldcurves.FlatForward.discount()

        final Date today = new Settings().evaluationDate();

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = today.add(days[i]);
            expected[i] = localTermStructure.discount(anotherDay);
        }

        final Date nextMonth = today.add(30);
        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];
View Full Code Here

Examples of org.jquantlib.termstructures.yieldcurves.FlatForward.discount()

        new Settings().setEvaluationDate(nextMonth);
        /*@DiscountFactor*/ final double[] calculated = new /*@DiscountFactor*/ double[days.length];

        for (int i=0; i<days.length; i++) {
            final Date anotherDay = nextMonth.add(days[i]);
            calculated[i] = localTermStructure.discount(anotherDay);
        }

        for (int i=0; i<days.length; i++) {
            if (!Closeness.isClose(expected[i],calculated[i])) {
                fail("\n  Discount at " + days[i] + " days:\n"
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.