Package org.jquantlib.termstructures.yieldcurves

Examples of org.jquantlib.termstructures.yieldcurves.ZeroSpreadedTermStructure


        assert(freq!=Frequency.NoFrequency && freq != Frequency.Once):"invalid frequency:" + freq.toString();

        final Handle<Quote> zSpreadQuoteHandle = new Handle<Quote>(new SimpleQuote(
                zSpread));

        final ZeroSpreadedTermStructure spreadedCurve = new ZeroSpreadedTermStructure(
                discountCurve, zSpreadQuoteHandle, comp, freq, dc);
        /* @Real */double price = 0.0;
        for (int i = 0; i < cashflows.size(); ++i) {
            if (cashflows.get(i).hasOccurred(settlement)) {
                continue;
            }
            final Date couponDate = cashflows.get(i).date();
            /* @Real */final double amount = cashflows.get(i).amount();
            price += amount * spreadedCurve.discount(couponDate);
        }
        price /= spreadedCurve.discount(settlement);
        return price / faceAmount * 100.0;
    }
View Full Code Here


        assert(freq!=Frequency.NoFrequency && freq != Frequency.Once):"invalid frequency:" + freq.toString();

        final Handle<Quote> zSpreadQuoteHandle = new Handle<Quote>(new SimpleQuote(
                zSpread));

        final ZeroSpreadedTermStructure spreadedCurve = new ZeroSpreadedTermStructure(
                discountCurve, zSpreadQuoteHandle, comp, freq, dc);
        /* @Real */double price = 0.0;
        for (int i = 0; i < cashflows.size(); ++i) {
            if (cashflows.get(i).hasOccurred(settlement)) {
                continue;
            }
            final Date couponDate = cashflows.get(i).date();
            /* @Real */final double amount = cashflows.get(i).amount();
            price += amount * spreadedCurve.discount(couponDate);
        }
        price /= spreadedCurve.discount(settlement);
        return price / faceAmount * 100.0;
    }
View Full Code Here

TOP

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

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.