Package org.jquantlib.indexes

Examples of org.jquantlib.indexes.IborIndex


  public DepositRateHelper(final Handle<Quote> rate,
                final IborIndex iborIndex) {
        super(rate);
        QL.validateExperimentalMode();

        this.iborIndex = new IborIndex(
                      "no-fix", // never take fixing into account
                      iborIndex.tenor(), iborIndex.fixingDays(), new Currency(),
                      iborIndex.fixingCalendar(), iborIndex.businessDayConvention(),
                      iborIndex.endOfMonth(), iborIndex.dayCounter(), this.termStructureHandle);
        initializeDates();
View Full Code Here


                final  /*@Rate*/ double  rate,
                final IborIndex i) {
        super(rate);
        QL.validateExperimentalMode();

        this.iborIndex = new IborIndex(
                      "no-fix", // never take fixing into account
                      i.tenor(), i.fixingDays(), new Currency(),
                      i.fixingCalendar(), i.businessDayConvention(),
                      i.endOfMonth(), i.dayCounter(), this.termStructureHandle);
        initializeDates();
View Full Code Here

        else{
            startDate = termStructure.currentLink().referenceDate().add(indexTenor);
            maturity = termStructure.currentLink().referenceDate().add(length);
        }

        final IborIndex dummyIndex = new IborIndex("dummy",
                indexTenor,
                index.fixingDays(),
                index.currency(),
                index.fixingCalendar(),
                index.businessDayConvention(),
View Full Code Here

        // setup swaps
        final Frequency swFixedLegFrequency = Frequency.Annual;
        final BusinessDayConvention swFixedLegConvention = BusinessDayConvention.Unadjusted;
        final DayCounter swFixedLegDayCounter = new Thirty360(Convention.European);
        final IborIndex  swFloatingLegIndex = new Euribor6M(new Handle<YieldTermStructure>());

        // TODO and FIXME: not sure whether the class stuff works properly
        // final IborIndex swFloatingLegIndex = Euribor.getEuribor6M(new Handle<YieldTermStructure>(YieldTermStructure.class)); //FIXME::RG::Handle
//        final YieldTermStructure nullYieldTermStructure = new AbstractYieldTermStructure() {
//            @Override
//            protected double discountImpl(final double t) {
//                throw new UnsupportedOperationException();
//            }
//            @Override
//            public Date maxDate() {
//                throw new UnsupportedOperationException();
//            }
//        };
//        final IborIndex swFloatingLegIndex = new Euribor6M(new Handle<YieldTermStructure>(nullYieldTermStructure));


        final Period forwardStart = new Period(1, TimeUnit.Days);
       
        final RateHelper s2y = new SwapRateHelper(
              new Handle<Quote>(s2yRate),
              new Period(2, TimeUnit.Years),
              calendar,
              swFixedLegFrequency,
              swFixedLegConvention,
              swFixedLegDayCounter,
              swFloatingLegIndex,
              new Handle<Quote>(),
              forwardStart);
         final RateHelper s3y = new SwapRateHelper(
                 new Handle<Quote>(s3yRate),
                 new Period(3, TimeUnit.Years),
                 calendar,
                 swFixedLegFrequency,
                 swFixedLegConvention,
                 swFixedLegDayCounter,             
                 swFloatingLegIndex,
                 new Handle<Quote>(),
                 forwardStart);
        final RateHelper  s5y = new SwapRateHelper(
                new Handle<Quote>(s5yRate),
                new Period(5, TimeUnit.Years),
                calendar,
                swFixedLegFrequency,
                swFixedLegConvention,
                swFixedLegDayCounter,
                swFloatingLegIndex,
                new Handle<Quote>(),
                forwardStart);
        final RateHelper s10y = new SwapRateHelper(
                new Handle<Quote>(s10yRate),
                new Period(10, TimeUnit.Years),
                calendar,
                swFixedLegFrequency,
                swFixedLegConvention,
                swFixedLegDayCounter,
                swFloatingLegIndex,
                new Handle<Quote>(),
                forwardStart);
        final RateHelper  s15y = new SwapRateHelper(
                new Handle<Quote>(s15yRate),
                new Period(15, TimeUnit.Years),
                calendar,
                swFixedLegFrequency,
                swFixedLegConvention,
                swFixedLegDayCounter,
                swFloatingLegIndex,
                new Handle<Quote>(),
                forwardStart);

         /*********************
         ** CURVE BUILDING **
         *********************/
       
         // Any DayCounter would be fine.
         // ActualActual::ISDA ensures that 30 years is 30.0
       
         // A depo-swap curve
         final List<RateHelper> depoSwapInstruments = new ArrayList<RateHelper>();
         depoSwapInstruments.add(d1w);
         depoSwapInstruments.add(d1m);
         depoSwapInstruments.add(d3m);
         depoSwapInstruments.add(d6m);
         depoSwapInstruments.add(d9m);
         depoSwapInstruments.add(d1y);
         depoSwapInstruments.add(s2y);
         depoSwapInstruments.add(s3y);
         depoSwapInstruments.add(s5y);
         depoSwapInstruments.add(s10y);
         depoSwapInstruments.add(s15y);
        
         final RateHelper[] instruments = new RateHelper[depoSwapInstruments.size()];
         depoSwapInstruments.toArray(instruments);
         final Handle[] jumps= new Handle[0];//]<Quote>[]) new ArrayList<Handle<Quote>>().toArray();
         final Date[] jumpDates = new Date[0];// new ArrayList<Date>().toArray();
        
         final YieldTermStructure  depoSwapTermStructure =
             new PiecewiseYieldCurve<Discount,LogLinear,IterativeBootstrap>(
                 Discount.class, LogLinear.class, IterativeBootstrap.class,
                 settlementDate,
                 instruments,
                 termStructureDayCounter,
                 jumps,
                 jumpDates,
                 tolerance,
            interpolator,/*Hack*/
             bootstrap /*Hack*/){/* anonymous */};

         // Term structures that will be used for pricing:
         // the one used for discounting cash flows
         final RelinkableHandle<YieldTermStructure> discountingTermStructure = new RelinkableHandle<YieldTermStructure>();
         // the one used for forward rate forecasting
         final RelinkableHandle<YieldTermStructure> forecastingTermStructure = new RelinkableHandle<YieldTermStructure>();
       
         /*********************
         * BONDS TO BE PRICED *
         **********************/
       
         // Common data
         final double faceAmount = 100;
       
         // Pricing engine
        final PricingEngine  bondEngine = new DiscountingBondEngine(discountingTermStructure);
       
         // Zero coupon bond
         final ZeroCouponBond zeroCouponBond = new ZeroCouponBond(
                           settlementDays,
                           new UnitedStates(UnitedStates.Market.GOVERNMENTBOND),
                           faceAmount,
                           new Date(15,Month.August,2013),
                           BusinessDayConvention.Following,
                           116.92,
                           new Date(15,Month.August,2003));
       
         zeroCouponBond.setPricingEngine(bondEngine);
       
         // Fixed 4.5% US Treasury Note
         final Schedule fixedBondSchedule = new Schedule(
                     new Date(15, Month.May, 2007),
                     new Date(15,Month.May,2017),
                     new Period(Frequency.Semiannual),
                     new UnitedStates(UnitedStates.Market.GOVERNMENTBOND),
                     BusinessDayConvention.Unadjusted,
                     BusinessDayConvention.Unadjusted,
                     DateGeneration.Rule.Backward, false);
       
         final FixedRateBond fixedRateBond = new FixedRateBond(
                     settlementDays,
                     faceAmount,
                     fixedBondSchedule,
                     new double[]{0.045},
                     new ActualActual(ActualActual.Convention.Bond),
                     BusinessDayConvention.ModifiedFollowing,
                     100.0,
                     new Date(15, Month.May, 2007));
       
         fixedRateBond.setPricingEngine(bondEngine);
       
         // Floating rate bond (3M USD Libor + 0.1%)
         // Should and will be priced on another curve later...
       
         final RelinkableHandle<YieldTermStructure> liborTermStructure = new RelinkableHandle<YieldTermStructure>();
         final IborIndex libor3m =  new USDLibor(new Period(3, TimeUnit.Months), liborTermStructure);
         libor3m.addFixing(new Date(17, Month.July, 2008), 0.0278625);
       
         final Schedule floatingBondSchedule = new Schedule(
                     new Date(21, Month.October, 2005),
                     new Date(21, Month.October, 2010), new Period(Frequency.Quarterly),
                     new UnitedStates(UnitedStates.Market.NYSE),
View Full Code Here

   
    QL.require(monthsToEnd > monthsToStart,
        "monthsToEnd must be greater than monthsToStart");
    QL.validateExperimentalMode();
 
    this.iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        new Period(monthsToEnd - monthsToStart, TimeUnit.Months),
        fixingDays, new Currency(), calendar, convention, endOfMonth,
        dayCounter, this.termStructureHandle);
View Full Code Here

   
    QL.require(monthsToEnd > monthsToStart,
        "monthsToEnd must be greater than monthsToStart");
    QL.validateExperimentalMode();

    iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        new Period(monthsToEnd - monthsToStart, TimeUnit.Months),
        fixingDays, new Currency(), calendar, convention, endOfMonth,
        dayCounter, this.termStructureHandle);
View Full Code Here

    super(rate);
    this.periodToStart = new Period(monthsToStart, TimeUnit.Months);

    QL.validateExperimentalMode();
   
    iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        i.tenor(), i.fixingDays(), new Currency(), i.fixingCalendar(),
        i.businessDayConvention(), i.endOfMonth(), i.dayCounter(),
        this.termStructureHandle);
View Full Code Here

    super(rate);
    this.periodToStart = new Period(monthsToStart, TimeUnit.Months);

    QL.validateExperimentalMode();
   
    iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        i.tenor(), i.fixingDays(), new Currency(), i.fixingCalendar(),
        i.businessDayConvention(), i.endOfMonth(), i.dayCounter(),
        this.termStructureHandle);
View Full Code Here

    super(rate);
    this.periodToStart = periodToStart;
 
    QL.validateExperimentalMode();

    iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        new Period(lengthInMonths, TimeUnit.Months), fixingDays,
        new Currency(), calendar, convention, endOfMonth, dayCounter,
        this.termStructureHandle);
View Full Code Here

    super(rate);
    this.periodToStart = periodToStart;
   
    QL.validateExperimentalMode();

    iborIndex = new IborIndex(
        "no-fix", // never take fixing into account
        new Period(lengthInMonths, TimeUnit.Months), fixingDays,
        new Currency(), calendar, convention, endOfMonth, dayCounter,
        this.termStructureHandle);
    initializeDates();
View Full Code Here

TOP

Related Classes of org.jquantlib.indexes.IborIndex

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.