Package org.jquantlib.cashflow

Examples of org.jquantlib.cashflow.Leg


        this.spread = spread;
        this.floatingDayCount = floatingDayCount;
        this.paymentConvention = paymentConvention;
        //FIXME this.fixingDays = fixingDays;

        final Leg fixedLeg = new FixedRateLeg(fixedSchedule, fixedDayCount)
        .withNotionals(nominal)
        .withCouponRates(fixedRate)
        .withPaymentAdjustment(paymentConvention)
        .Leg();

        // JM where are gearings set they cannot be null for the floating leg.
        final Leg floatingLeg = new IborLeg(floatingSchedule, iborIndex)
        .withNotionals(nominal)
        .withPaymentDayCounter(floatingDayCount)
        .withPaymentAdjustment(paymentConvention)

        //FIXME:: .withFixingDays (fixingDays) // FIXME: slight deviation from quantlib, need to expose fixing days up the stack
View Full Code Here


            final VanillaSwap.ArgumentsImpl a = (VanillaSwap.ArgumentsImpl) arguments;

            a.type = type;
            a.nominal = nominal;

            final Leg fixedCoupons = fixedLeg();

            a.fixedResetDates = new ArrayList<Date>(fixedCoupons.size());
            a.fixedPayDates = new ArrayList<Date>(fixedCoupons.size());
            a.fixedCoupons = new ArrayList</*@Real*/ Double>(fixedCoupons.size());

            for (int i=0; i<fixedCoupons.size(); i++) {
                final FixedRateCoupon coupon = (FixedRateCoupon) fixedCoupons.get(i);
                a.fixedPayDates.set(i, coupon.date());
                a.fixedResetDates.set(i, coupon.accrualStartDate());
                a.fixedCoupons.set(i, coupon.amount());
            }

            final Leg floatingCoupons = floatingLeg();

            a.floatingResetDates = new ArrayList<Date>(floatingCoupons.size());
            a.floatingPayDates = new ArrayList<Date>(floatingCoupons.size());
            a.floatingFixingDates = new ArrayList<Date>(floatingCoupons.size());

            a.floatingAccrualTimes = new ArrayList</*@Time*/ Double>(floatingCoupons.size());
            a.floatingSpreads = new ArrayList</*@Spread*/ Double>(floatingCoupons.size());
            a.floatingCoupons = new ArrayList</*@Real*/ Double>(floatingCoupons.size());
            for (int i=0; i<floatingCoupons.size(); ++i) {
                final IborCoupon coupon = (IborCoupon) floatingCoupons.get(i);

                a.floatingResetDates.set(i, coupon.accrualStartDate());
                a.floatingPayDates.set(i, coupon.date());

                a.floatingFixingDates.set(i, coupon.fixingDate());
View Full Code Here

        this.liborFraction = liborFraction;
        this.liborSpread = liborSpread;

        final BusinessDayConvention convention = liborSchedule.businessDayConvention();
       
        final Leg iborLeg = new IborLeg(liborSchedule, liborIndex)
                      .withNotionals(nominal)
                      .withPaymentDayCounter(liborDayCount)
                      .withPaymentAdjustment(convention)
                      .withFixingDays(liborIndex.fixingDays())
                      .withGearings(liborFraction)
                      .withSpreads(liborSpread)
                      .Leg();
        this.legs.add(iborLeg);

        final Leg bmaLeg = new AverageBMALeg(bmaSchedule, bmaIndex)
                      .withNotionals(nominal)
                      .withPaymentDayCounter(bmaDayCount)
                      .withPaymentAdjustment(bmaSchedule.businessDayConvention())
                      .Leg();
       
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

                else
                    moreArgs.callabilityTriggers.add(Constants.NULL_REAL);
            }
        }

        final Leg cashflows = bond_.cashflows();

        moreArgs.couponDates.clear();
        moreArgs.couponAmounts.clear();
        for (int i=0; i<cashflows.size()-1; i++) {
            if (!cashflows.get(i).hasOccurred(settlement)) {
                moreArgs.couponDates.add(cashflows.get(i).date());
                moreArgs.couponAmounts.add(cashflows.get(i).amount());
            }
        }

        moreArgs.dividends.clear();
        moreArgs.dividendDates.clear();
View Full Code Here

        this.spread = spread;
        this.floatingDayCount = floatingDayCount;
        this.paymentConvention = paymentConvention;
        //FIXME this.fixingDays = fixingDays;

        final Leg fixedLeg = new FixedRateLeg(fixedSchedule, fixedDayCount)
        .withNotionals(nominal)
        .withCouponRates(fixedRate)
        .withPaymentAdjustment(paymentConvention)
        .Leg();

        // JM where are gearings set they cannot be null for the floating leg.
        final Leg floatingLeg = new IborLeg(floatingSchedule, iborIndex)
        .withNotionals(nominal)
        .withPaymentDayCounter(floatingDayCount)
        .withPaymentAdjustment(paymentConvention)

        //FIXME:: .withFixingDays (fixingDays) // FIXME: slight deviation from quantlib, need to expose fixing days up the stack
View Full Code Here

            final VanillaSwap.ArgumentsImpl a = (VanillaSwap.ArgumentsImpl) arguments;

            a.type = type;
            a.nominal = nominal;

            final Leg fixedCoupons = fixedLeg();

            a.fixedResetDates = new ArrayList<Date>(fixedCoupons.size());
            a.fixedPayDates = new ArrayList<Date>(fixedCoupons.size());
            a.fixedCoupons = new ArrayList</*@Real*/ Double>(fixedCoupons.size());

            for (int i=0; i<fixedCoupons.size(); i++) {
                final FixedRateCoupon coupon = (FixedRateCoupon) fixedCoupons.get(i);
                a.fixedPayDates.set(i, coupon.date());
                a.fixedResetDates.set(i, coupon.accrualStartDate());
                a.fixedCoupons.set(i, coupon.amount());
            }

            final Leg floatingCoupons = floatingLeg();

            a.floatingResetDates = new ArrayList<Date>(floatingCoupons.size());
            a.floatingPayDates = new ArrayList<Date>(floatingCoupons.size());
            a.floatingFixingDates = new ArrayList<Date>(floatingCoupons.size());

            a.floatingAccrualTimes = new ArrayList</*@Time*/ Double>(floatingCoupons.size());
            a.floatingSpreads = new ArrayList</*@Spread*/ Double>(floatingCoupons.size());
            a.floatingCoupons = new ArrayList</*@Real*/ Double>(floatingCoupons.size());
            for (int i=0; i<floatingCoupons.size(); ++i) {
                final IborCoupon coupon = (IborCoupon) floatingCoupons.get(i);

                a.floatingResetDates.set(i, coupon.accrualStartDate());
                a.floatingPayDates.set(i, coupon.date());

                a.floatingFixingDates.set(i, coupon.fixingDate());
View Full Code Here

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

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

        evaluationDate.addObserver(this);
    }

    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

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.