Package org.jquantlib.daycounters

Examples of org.jquantlib.daycounters.Actual365Fixed$Impl


     *
     * @param referenceDate
     * @see YieldTermStructure#YieldTermStructure(Date, Calendar, DayCounter)
     */
    protected AbstractYieldTermStructure(final Date referenceDate) {
        super(referenceDate, new Target(), new Actual365Fixed());
    }
View Full Code Here


     * @param settlementDays
     * @param cal
     * @see YieldTermStructure#YieldTermStructure(int, Calendar, DayCounter)
     */
    protected AbstractYieldTermStructure(final int settlementDays, final Calendar cal) {
        super(settlementDays, cal, new Actual365Fixed());
    }
View Full Code Here

     *
     * @param settlementDays
     * @see YieldTermStructure#YieldTermStructure(int, Calendar, DayCounter)
     */
    protected AbstractYieldTermStructure(final int settlementDays) {
        super(settlementDays, new Target(), new Actual365Fixed());
    }
View Full Code Here

                2, // settlement days
                new EURCurrency(),
                new Target(),
                euriborConvention(tenor),
                euriborEOM(tenor),
                new Actual365Fixed(),
                h);
        QL.require(this.tenor().units() != TimeUnit.Days , "for daily tenors dedicated DailyTenor constructor must be used"); // TODO: message
    }
View Full Code Here

        clock.startClock();

        System.out.println("//==========================================FlatForward termstructure===================");
        final SimpleQuote interestRateQuote = new SimpleQuote(0.3);
        final RelinkableHandle<Quote>  handleToInterestRateQuote = new RelinkableHandle<Quote>(interestRateQuote);
        final YieldTermStructure flatforward = new FlatForward(2,new UnitedStates(Market.NYSE),handleToInterestRateQuote,new Actual365Fixed(), Compounding.Continuous,Frequency.Daily);

        final Date today  = Date.todaysDate();
        final Date date10 = today.clone().addAssign(10);
        final Date date20 = today.clone().addAssign(20);
        final Date date30 = today.clone().addAssign(30);
        final Date date40 = today.clone().addAssign(40);
        final Date date50 = today.clone().addAssign(50);


        //Calculating discount factor
        System.out.println("The discount factor for the date 30 days from today is = "+flatforward.discount(date30.clone()));

        //Calculating forward rate
        System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+flatforward.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //Calculating parRate for the dates as shown below-
        final Date[] dates = { date10.clone(), date20.clone(), date30.clone(), date40.clone(), date50.clone() };
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+flatforward.parRate(dates, Frequency.Semiannual, false));

        //Calculating zero rate
        System.out.println("The zero rate for the bond having coupon date as 10 days from today = "+flatforward.zeroRate(date10.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        System.out.println("//==========================================ForwardSpreadedTermStructure==================");
        //As the name suggests this termstructure adds a spread to the forward rates it calculates by getting the spread rate
        //from the spread rate quote
        final SimpleQuote spreadRateQuote = new SimpleQuote(0.2);
        final RelinkableHandle<Quote>  handleToSpreadRateQuote = new RelinkableHandle<Quote>(spreadRateQuote);

        final ForwardRateStructure forwardSpreadedTermStructure = new ForwardSpreadedTermStructure(new RelinkableHandle<YieldTermStructure>(flatforward),handleToSpreadRateQuote);

        //Calculating discount factor.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The discount factor for the date 30 days from today is = "+forwardSpreadedTermStructure.discount(date30.clone()));

        //Calculating forward rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The forward rate between the date 30 days from today to 50 days from today is = "+forwardSpreadedTermStructure.forwardRate(date30.clone(), date50.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //Calculating parRate for the dates(as used in the FlatForward case) as shown below-
        System.out.println("The par rate for the bond having coupon dates as shown above is = "+forwardSpreadedTermStructure.parRate(dates, Frequency.Semiannual, false));

        //Calculating zero rate.This termstructure adds the spread as specified by the spread quote and then calculates the discount.
        System.out.println("The zero rate for the bond having coupon date as 10 days from today = "+forwardSpreadedTermStructure.zeroRate(date10.clone(), new Actual365Fixed(), Compounding.Continuous).rate());

        //===========================================ImpliedTermStructure============================

        //As the name suggests the implied termstructure holds a reference to an underlying tremstructure and gives the same calulated values
        //as the underlying termstructure.Here the FlatForward termstructure instantiated right at the top has been taken as an underlying.
View Full Code Here

                settlementDays, // settlement days
                new EURCurrency(),
                new Target(),
                euriborConvention(new Period(1,TimeUnit.Days)),
                euriborEOM(new Period(1,TimeUnit.Days)),
                new Actual365Fixed(),
                h);
      }
View Full Code Here

                  << std::endl;
            std::cout << rule << std::endl;
             */

            //bootstrap the yield/vol curves
            final DayCounter dayCounter = new Actual365Fixed();
            final Handle<Quote> h1 = new Handle<Quote>(riskFreeRate.currentLink());
            final Handle<Quote> h2 = new Handle<Quote>(volatility.currentLink());
            final Handle<YieldTermStructure> flatRate = new Handle<YieldTermStructure>(new FlatForward(0, new NullCalendar(), h1, dayCounter));
            final Handle<BlackConstantVol> flatVol = new Handle<BlackConstantVol>(new BlackConstantVol(0, new NullCalendar(), h2, dayCounter));

View Full Code Here

    public InflationTermStructure(final Period lag,
                    final Frequency frequency,
                    final @Rate double baseRate,
                    final Handle<YieldTermStructure> yTS) {

      this(lag, frequency, baseRate, yTS, new Actual365Fixed());
  
    }
View Full Code Here

          final Period lag,
        final Frequency frequency,
        final @Rate double baseRate,
        final Handle<YieldTermStructure> yTS) {

      this(referenceDate, lag, frequency, baseRate, yTS, new NullCalendar() ,new Actual365Fixed());
    }
View Full Code Here

        final Period lag,
        final Frequency frequency,
        final @Rate double baseRate,
        final Handle<YieldTermStructure> yTS) {

      this(settlementDays, calendar, lag, frequency, baseRate, yTS, new Actual365Fixed());

    }
View Full Code Here

TOP

Related Classes of org.jquantlib.daycounters.Actual365Fixed$Impl

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.