Package org.jquantlib.termstructures.yieldcurves

Examples of org.jquantlib.termstructures.yieldcurves.ForwardRateStructure


        //As the name suggests this termstructure adds a spread to the forward rates it calculates by getting the spread rate
        //from the spread rate quote
        final SimpleQuote spreadRateQuote = new SimpleQuote(0.2);
        final RelinkableHandle<Quote>  handleToSpreadRateQuote = new RelinkableHandle<Quote>(spreadRateQuote);

        final ForwardRateStructure forwardSpreadedTermStructure = new ForwardSpreadedTermStructure(new RelinkableHandle<YieldTermStructure>(flatforward),handleToSpreadRateQuote);

        //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.
        System.out.println("The zero rate for the bond having coupon date as 10 days from today = "+forwardSpreadedTermStructure.zeroRate(date10.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //===========================================ImpliedTermStructure============================

        //As the name suggests the implied termstructure holds a reference to an underlying tremstructure and gives the same calulated values
        //as the underlying termstructure.Here the FlatForward termstructure instantiated right at the top has been taken as an underlying.
View Full Code Here

TOP

Related Classes of org.jquantlib.termstructures.yieldcurves.ForwardRateStructure

Copyright © 2018 www.massapicom. 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.