Package org.jquantlib.time

Examples of org.jquantlib.time.Date.gt()


        Date d = Date.minDate();
        for (int i = 0; i < cashflows.size(); i++) {
            d = Date.max(d, cashflows.get(i).date());
        }
        // TODO: code review :: please verify against QL/C++ code
        QL.ensure (d.gt(Date.minDate()), no_cashflows);
        return d;
    }


    public double npv(
View Full Code Here


    }

    public Pair<Double, Double> convertDates(final Date optionDate, final Period swapTenor) {
        final Date end = optionDate.add(swapTenor);
        // TODO: code review :: please verify against QL/C++ code
        QL.require(end.gt(optionDate) , "negative swap tenorgiven"); // TODO: message
        final double optionTime = timeFromReference(optionDate);
        final double timeLength = dayCounter().yearFraction(optionDate, end);
        return new Pair<Double, Double>(optionTime, timeLength);
    }
View Full Code Here

    }

    public Date settlementDate() {
        final Period advance = new Period (settlementDays, TimeUnit.Days);
        final Date settle = calendar.advance (new Settings ().evaluationDate (), advance);
        if (settle.gt (valueDate)) {
            return settle;
        }
        return valueDate;
    }
View Full Code Here

        double delta_theta = 0.0, delta_rho = 0.0;
        for (int i = 0; i < a.cashFlow.size(); i++) {
            final CashFlow cashflow = a.cashFlow.get(i);
            final Date d = cashflow.date();
            if (d.gt(settlementDate)) {
                delta_theta -= cashflow.amount()
                * process.riskFreeRate().currentLink().zeroRate(d, rfdc, Compounding.Continuous, Frequency.Annual).rate()
                * process.riskFreeRate().currentLink().discount(d);
                delta_rho += cashflow.amount() * process.time(d) * process.riskFreeRate().currentLink().discount(t);
            }
View Full Code Here

            if (!IMM.isIMMdate(immDate, false)) {
                fail("\n  " + immDate.weekday() + " " + immDate + " is not an IMM date (calculated from " + counter.weekday() + " " + counter + ")");
            }

            // check that imm is <= to the next IMM date in the main cycle
            if (immDate.gt(IMM.nextDate(counter, true))) {
                fail("\n  " + immDate.weekday() + " " + immDate + " is not less than or equal to the next future in the main cycle " + IMM.nextDate(counter, true));
            }

            //
            // COMMENTED AT SOURCE QuantLib 0.8.1
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.