Examples of forwardRate()


Examples of org.jquantlib.instruments.ForwardRateAgreement.forwardRate()

            final ForwardRateAgreement fra = new ForwardRateAgreement(start, end, Position.Long,
                                      fraData[i].rate/100, 100.0,
                                      euribor3m, curveHandle);
            /*@Rate*/ final double expectedRate  = fraData[i].rate/100;
            /*@Rate*/ final double estimatedRate = fra.forwardRate().rate();
            if (Math.abs(expectedRate-estimatedRate) > tolerance) {
              throw new RuntimeException(
                  String.format("#%d %s %s %f %s %f",
                  i+1, " FRA failure:",
                            "\n  estimated rate: ", estimatedRate,
View Full Code Here

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

        /* @Diffusion */final double sigma = diffusion(t, x);
        // we could be more anticipatory if we know the right dt
        // for which the drift will be used
        /* @Time */final double t1 = t + 0.0001;
        final YieldTermStructure yts = riskFreeRate.currentLink();
        /* @Rate */final double r = yts.forwardRate(t, t1, Compounding.Continuous, Frequency.NoFrequency, true).rate();

        final YieldTermStructure divTs = dividendYield.currentLink();
        final double d = divTs.forwardRate(t, t1, Compounding.Continuous, Frequency.NoFrequency, true).rate();
        return r - d - 0.5 * sigma * sigma;
    }
View Full Code Here

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

        /* @Time */final double t1 = t + 0.0001;
        final YieldTermStructure yts = riskFreeRate.currentLink();
        /* @Rate */final double r = yts.forwardRate(t, t1, Compounding.Continuous, Frequency.NoFrequency, true).rate();

        final YieldTermStructure divTs = dividendYield.currentLink();
        final double d = divTs.forwardRate(t, t1, Compounding.Continuous, Frequency.NoFrequency, true).rate();
        return r - d - 0.5 * sigma * sigma;
    }

    @Override
    public/* @Diffusion */double diffusion(
View Full Code Here

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

        //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-
        final Date[] dates = { date10.clone(), date20.clone(), date30.clone(), date40.clone(), date50.clone() };
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+flatforward.parRate(dates, Frequency.Semiannual, false));
View Full Code Here

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

        //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-
        final Date[] dates = { date10.clone(), date20.clone(), date30.clone(), date40.clone(), date50.clone() };
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+flatforward.parRate(dates, Frequency.Semiannual, false));
View Full Code Here

Examples of org.jquantlib.termstructures.yieldcurves.ForwardRateStructure.forwardRate()

        //Calculating discount factor.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The discount factor for the date 30 days from today is = "+forwardSpreadedTermStructure.discount(date30.clone()));

        //Calculating forward rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+forwardSpreadedTermStructure.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //Calculating parRate for the dates(as used in the FlatForward case) as shown below-
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+forwardSpreadedTermStructure.parRate(dates, Frequency.Semiannual, false));

        //Calculating zero rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
View Full Code Here

Examples of org.jquantlib.termstructures.yieldcurves.ForwardSpreadedTermStructure.forwardRate()

        //Calculating discount factor.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The discount factor for the date 30 days from today is = "+forwardSpreadedTermStructure.discount(date30.clone()));

        //Calculating forward rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+forwardSpreadedTermStructure.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //Calculating parRate for the dates(as used in the FlatForward case) as shown below-
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+forwardSpreadedTermStructure.parRate(dates, Frequency.Semiannual, false));

        //Calculating zero rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
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.