Package org.jquantlib.cashflow

Examples of org.jquantlib.cashflow.Leg


                            new Brazil(Brazil.Market.SETTLEMENT),
                            BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted,
                            DateGeneration.Rule.Backward, false);

          // fixed coupons
          final Leg cashflows =
              new FixedRateLeg(schedule, new Actual360())
              .withNotionals(faceAmount)
              .withCouponRates(couponRates)
              .withPaymentAdjustment(BusinessDayConvention.ModifiedFollowing).Leg();
          // redemption
          cashflows.add(new SimpleCashFlow(faceAmount, cashflows.last().date()));

          final Bond bond = new Bond(settlementDays, new Brazil(Brazil.Market.SETTLEMENT),
                    faceAmount, cashflows.last().date(),
                    new Date(1,Month.January,2007), cashflows);

          final double cachedPrice = prices[bondIndex];

          final double price = faceAmount*bond.dirtyPrice(yield.rate(),
 
View Full Code Here


        // QL.require(Bond.Results.class.isAssignableFrom(results.getClass()), ReflectConstants.WRONG_ARGUMENT_TYPE); // QA:[RG]::verified

        final Bond.ArgumentsImpl a = (Bond.ArgumentsImpl)arguments;
        final Bond.ResultsImpl   r = (Bond.ResultsImpl)results;

      final Leg cashflows = a.cashflows;
      final Date settlementDate = a.settlementDate;
      final Date valuationDate = discountCurve.currentLink().referenceDate();
        QL.require(! discountCurve.empty() , "no discounting term structure set"); //// TODO: message

        r.value           = CashFlows.getInstance().npv(cashflows, discountCurve, valuationDate,  valuationDate);
View Full Code Here

        this.calendar_ = (calendar);
        this.cashflows_ = (coupons);
        this.issueDate_ = (issueDate);
        this.notionals_ = new ArrayList<Double>();
        this.notionalSchedule_ = new ArrayList<Date>();
        this.redemptions_ = new Leg();

        if (!coupons.isEmpty()) {
            Collections.sort(cashflows_, new EarlierThanCashFlowComparator());
            maturityDate_ = coupons.get(coupons.size() - 1).date();
            addRedemptionsToCashflows();
View Full Code Here

    }

    protected Bond(
            final /* @Natural */int settlementDays,
            final Calendar calendar) {
        this(settlementDays, calendar, new Date(), new Leg());
    }
View Full Code Here

    protected Bond(
            final /* @Natural */int settlementDays,
            final Calendar calendar,
            final Date issueDate) {
        this(settlementDays, calendar, issueDate, new Leg());
    }
View Full Code Here

        this.cashflows_ = (cashflows);
        this.maturityDate_ = (maturityDate);
        this.issueDate_ = (issueDate);
        this.notionalSchedule_ = new ArrayList<Date>();
        this.notionals_ = new ArrayList<Double>();
        this.redemptions_ = new Leg();

        if (!cashflows.isEmpty()) {
            notionalSchedule_.add(new Date());
            notionals_.add(faceAmount);
View Full Code Here

    protected Bond(
            final /* @Natural */int settlementDays,
            final Calendar calendar,
            final /* @Real */double faceAmount,
            final Date maturityDate) {
        this(settlementDays, calendar, faceAmount, maturityDate, new Date(), new Leg());
    }
View Full Code Here

            final /* @Natural */int settlementDays,
            final Calendar calendar,
            final /* @Real */double faceAmount,
            final Date maturityDate,
            final Date issueDate) {
        this(settlementDays, calendar, faceAmount, maturityDate, issueDate, new Leg());
    }
View Full Code Here

        this.discountCurve = discountCurve;
        this.frequency = Frequency.NoFrequency;

        this.notionals_ = new ArrayList<Double>();
        this.notionalSchedule_ = new ArrayList<Date>();
        this.redemptions_ = new Leg();

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

        evaluationDate.addObserver(this);
        this.discountCurve.addObserver(this);
View Full Code Here

      final Schedule schedule,
      final double redemption){
    super(exercise, conversionRatio, dividends, callability, creditSpread,
            issueDate, settlementDays, dayCounter, schedule, redemption);

    cashflows_ = new Leg();

        // notional forcibly set to 100
        setSingleRedemption(100.0, redemption, maturityDate_);

        this.option = new ConvertibleBondOption(this, exercise, conversionRatio,
View Full Code Here

TOP

Related Classes of org.jquantlib.cashflow.Leg

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.