Package org.jquantlib

Examples of org.jquantlib.Settings


     * @param settlement
     * @return
     */
    final public int nextCashFlowIndex(final Leg cashFlows, Date settlement) {
        if (settlement.isNull()) {
            settlement = new Settings().evaluationDate();
        }
        for (int i = 0; i < cashFlows.size(); ++i) {
            // the first coupon paying after d is the one we're after
            if (!cashFlows.get(i).hasOccurred(settlement))
                return i;
View Full Code Here


            this.dayCounter = dayCounter;
        } else {
            this.dayCounter = index_.dayCounter();
        }

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

        // TODO: code review :: please verify against QL/C++ code
        // seems like we should have this.evaluationDate

        this.index_.addObserver(this);
View Full Code Here

     * <p>
     * This should be the only place in the code that is affected
     * directly by {@link Settings#isTodaysPayments()}
     */
    public boolean hasOccurred(final Date d) /* @ReadOnly */ {
        return hasOccurred(d, new Settings().isTodaysPayments());
    }
View Full Code Here

                dayCounter, isInArrears);
    }

    @Override
    public double indexFixing() {
        final Settings settings = new Settings();
        if (settings.isUseIndexedCoupon())
            return index_.fixing(fixingDate());
        if (isInArrears())
            return index_.fixing(fixingDate());
        else {
            final Handle<YieldTermStructure> termStructure = index_.termStructure();
            QL.require(termStructure != null , NULL_TERM_STRUCTURE)// QA:[RG]::verified
            final Date today = settings.evaluationDate();
            final Date fixing_date = fixingDate();
            final IndexManager indexManager = IndexManager.getInstance();
            if (fixing_date.lt(today)) {
                final double pastFixing = indexManager.getHistory(index_.name()).get(fixing_date);
                QL.require(!Double.isNaN(pastFixing), "Missing fixing"); // TODO: message
View Full Code Here

     */
    public double npv(final Leg cashflows, final InterestRate irr, final Date settlementDate) {

        Date date = settlementDate;
        if (date.isNull()) {
            date = new Settings().evaluationDate();
        }

        final YieldTermStructure flatRate = new FlatForward(date, irr.rate(), irr.dayCounter(), irr.compounding(), irr.frequency());
        return npv(cashflows, new Handle<YieldTermStructure>(flatRate), date, date, 0);
    }
View Full Code Here

     */

    public double bps (final Leg cashflows, final Handle <YieldTermStructure> discountCurve)
    {
        // default variable of settlement date
        return bps (cashflows, discountCurve, new Settings().evaluationDate());
    }
View Full Code Here

     * according to the given term structure.
     */
    public double bps(final Leg cashflows, final InterestRate irr, Date settlementDate){
        if (settlementDate.isNull())
        {
            settlementDate = new Settings().evaluationDate();
        }
        final YieldTermStructure flatRate = new FlatForward(settlementDate, irr.rate(),
                    irr.dayCounter(), irr.compounding(), irr.frequency());
        return bps(cashflows, new Handle<YieldTermStructure>(flatRate), settlementDate, settlementDate);
     }
View Full Code Here

        return c.forwardRate(d, d, c.dayCounter(), Compounding.Continuous, Frequency.Annual, true).rate();
    }

    @Override
    public double minValueAfter(final int i, final double[] data) {
        if (new Settings().isNegativeRates()) {
            // no constraints.
            // We choose as min a value very unlikely to be exceeded.
            return -3.0;
        }
        return Constants.QL_EPSILON;
View Full Code Here

    public RelativeDateRateHelper(/*@Real*/ final double d) {
        super(d);
        QL.validateExperimentalMode();

        this.evaluationDate = new Settings().evaluationDate();
        this.evaluationDate.addObserver(this);
        // XXX:registerWith
        //registerWith(this.evaluationDate);
    }
View Full Code Here

        //registerWith(this.evaluationDate);
    }

    public RelativeDateRateHelper(final Handle<Quote> quote) {
        super(quote);
        this.evaluationDate = new Settings().evaluationDate();
        this.evaluationDate.addObserver(this);
        // XXX:registerWith
        //registerWith(this.evaluationDate);
    }
View Full Code Here

TOP

Related Classes of org.jquantlib.Settings

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.