Package org.jquantlib

Examples of org.jquantlib.Settings


     */
    public double convexity(final Leg cashFlows, final InterestRate rate, final Date settlementDate) {

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

        final DayCounter dayCounter = rate.dayCounter();

        double P = 0.0;
View Full Code Here


        return previousCashFlow(leg, new Date());
    }

    final public int previousCashFlow(final Leg leg, Date refDate) {
        if (refDate.isNull()) {
            refDate = new Settings().evaluationDate();
        }

        if (!(leg.get(0).hasOccurred(refDate)))
            return leg.size();
View Full Code Here

     * @param settlement
     * @return
     */
    final public CashFlow nextCashFlow(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 cashFlows.get(i);
View Full Code Here

     * @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

        spread_ = coupon_.spread();
        final Date paymentDate = coupon_.date();
        final InterestRateIndex index = coupon_.index();
        final Handle<YieldTermStructure> rateCurve = index.termStructure();

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

        if(paymentDate.gt(today))
            discount_ = rateCurve.currentLink().discount(paymentDate);
        else
            discount_ = 1.0;
View Full Code Here

        (coupon_.accrualPeriod()*discount_);
    }

    public double optionletPrice(final Option.Type optionType, final double effStrike)  {
        final Date fixingDate = coupon_.fixingDate();
        if (fixingDate.le(new Settings().evaluationDate())) {
            // the amount is determined
            double a, b;
            if (optionType==Option.Type.Call) {
                a = coupon_.indexFixing();
                b = effStrike;
View Full Code Here

        return Constants.QL_EPSILON;
    }

    @Override
    public double maxValueAfter(final int i, final double[] data) {
        if (new Settings().isNegativeRates()) {
            // discount are not required to be decreasing --all bets are off.
            // We choose as max a value very unlikely to be exceeded.
            return 3.0;
        }
        // discounts cannot decrease
View Full Code Here

        super(payoff, exercise);
    }
   
    @Override
  public boolean isExpired() /* @ReadOnly */ {
        return exercise.lastDate().lt(new Settings().evaluationDate() );
    }
View Full Code Here

        final int fixingDays = 3;
        final int settlementDays = 3;

        final Date todaysDate = calendar.advance(settlementDate, -fixingDays, TimeUnit.Days);
        new Settings().setEvaluationDate(todaysDate);

        QL.info("Evaluation date: " + todaysDate.weekday() + ", " + todaysDate);
        QL.info("Settlement date: " + settlementDate.weekday() + ", " + settlementDate);

        // Building of the bonds discounting yield curve
View Full Code Here

            while (floorRates_.size() < floatingLeg_.size()) {
                floorRates_.add(floorRates_.get(floorRates_.size() - 1));
            }
        }

        final Date evaluationDate = new Settings().evaluationDate();
        for (final CashFlow cashFlow : floatingLeg_) {
            cashFlow.addObserver(this);
        }

        // TODO: code review :: please verify against QL/C++ code
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.