Package org.jquantlib.indexes

Examples of org.jquantlib.indexes.InterestRateIndex


    public void initialize( final FloatingRateCoupon coupon) {
        coupon_ =  (IborCoupon)coupon;
        gearing_ = coupon_.gearing();
        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);
View Full Code Here


    public void initialize( final FloatingRateCoupon coupon) {
        coupon_ =  (IborCoupon)coupon;
        gearing_ = coupon_.gearing();
        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);
View Full Code Here

  @Override
  public /* @Real */ double swapletRate() {

    List<Date> fixingDates = coupon.fixingDates();
    InterestRateIndex index = coupon.index();
   
    @Natural int cutoffDays = 0; // to be verified
    Date startDate = coupon.accrualStartDate().sub(cutoffDays);
    Date endDate = coupon.accrualEndDate().sub(cutoffDays);
    Date d1 = new Date(startDate.serialNumber());
    Date d2 = new Date(startDate.serialNumber());

    QL.require(fixingDates.size() > 0, "fixing date list empty");
    QL.require(index.valueDate(fixingDates.get(0)).le(startDate), "first fixing date valid after period start");
    QL.require(index.valueDate(fixingDates.get((fixingDates.size()-1))).ge(startDate), "last fixing date valid before period end");
   
    @Rate double avgBMA = 0.0;
    int days = 0;
   
    for (int i=0;i<(fixingDates.size()-1);i++) {
      Date valueDate = index.valueDate(fixingDates.get(i));
      Date nextValueDate = index.valueDate(fixingDates.get(i+1));
     
      if (fixingDates.get(i).ge(endDate) || valueDate.ge(valueDate)) {
        break;
      }
     
      if (fixingDates.get(i+1).lt(startDate) || nextValueDate.le(startDate)) {
        continue;
      }
     
      d2 = Date.min(nextValueDate, endDate);
      avgBMA += (index.fixing(fixingDates.get(i))) * (d2.sub(d1));
      days += d2.sub(d1);
     
      d1 = d2;
    }
   
View Full Code Here

TOP

Related Classes of org.jquantlib.indexes.InterestRateIndex

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.