Package org.jquantlib.daycounters

Examples of org.jquantlib.daycounters.DayCounter


                      final double spread,
                      final Date refPeriodStart,
                      final Date refPeriodEnd) {
        // default daycounter constructor
        this (paymentDate, nominal, startDate, endDate, fixingDays,
              index, gearing, spread, refPeriodStart, refPeriodEnd, new DayCounter());
    }
View Full Code Here


        Date date = settlementDate;
        if (date.isNull()) {
            date = new Settings().evaluationDate();
        }

        final DayCounter dayCounter = rate.dayCounter();

        double P = 0.0;
        double d2Pdy2 = 0.0;
        final double y = rate.rate();
        final int N = rate.frequency().toInteger();

        for (int i = 0; i < cashFlows.size(); ++i) {
            if (!cashFlows.get(i).hasOccurred(date)) {
                final double t = dayCounter.yearFraction(date, cashFlows.get(i).date());
                final double c = cashFlows.get(i).amount();
                final double B = rate.discountFactor(t);

                P += c * B;
                switch (rate.compounding()) {
View Full Code Here

        final Date paymentDate = iteratorLeg.get(iteratorIndex).date();
        boolean firstCouponFound = false;
        /* @Real */double nominal = Constants.NULL_REAL;
        /* @Time */double accrualPeriod = Constants.NULL_TIME;
        DayCounter dc = null;
        /* @Rate */double result = 0.0;

        for (int i = iteratorIndex; i < leg.size(); i++) {
            final CashFlow cf = iteratorLeg.get(i);
            if (cf.date().eq(paymentDate)) {
View Full Code Here

                      final double spread,
                      final Date refPeriodStart,
                      final Date refPeriodEnd) {
        // default daycounter constructor
        this (paymentDate, nominal, startDate, endDate, fixingDays,
              index, gearing, spread, refPeriodStart, refPeriodEnd, new DayCounter());
    }
View Full Code Here

    //

  public OptionletVolatilityStructure(
          final Calendar cal,
      final BusinessDayConvention bdc) {
    this(cal, bdc, new DayCounter());
  }
View Full Code Here

   */
  public OptionletVolatilityStructure(
          final Date referenceDate,
      final Calendar cal,
      final BusinessDayConvention bdc) {
    super(referenceDate, cal, bdc, new DayCounter());
  }
View Full Code Here

   */
  public OptionletVolatilityStructure(
          final int settlementDays,
      final Calendar cal,
      final BusinessDayConvention bdc) {
    this(settlementDays, cal, bdc, new DayCounter());
  }
View Full Code Here

        /*@Rate*/final double riskFreeRate = 0.06;
        final double volatility = 0.2;
        final double dividendYield = 0.00;

        final Date maturity = new Date(17, Month.May, 1999);
        final DayCounter dayCounter = new Actual365Fixed();

        // write column headings
        //                 "         1         2         3         4         5         6         7         8"
        //                 "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
        System.out.println("                            Method      European      Bermudan      American");
View Full Code Here

        /* @Rate */ final double qRates[] = { 0.00, 0.10, 0.30 };
        /* @Rate */ final double rRates[] = { 0.01, 0.05, 0.15 };
        /* @Integer */ final int lengths[] = { 1, 2 };
        /* @Volatility */ final double vols[] = { 0.05, 0.20, 0.70 };

        final DayCounter dc = new Actual360();
        final Date today = Date.todaysDate();
        new Settings().setEvaluationDate(today);

        final SimpleQuote spot = new SimpleQuote(0.0);
        final SimpleQuote qRate = new SimpleQuote(0.0);
View Full Code Here

        QL.info("Testing dividend European option values with known value...");

        /* @Real */ final double tolerance = 1.0e-2;
        /* @Real */ final double expected = 3.67;

        final DayCounter dc = new Actual360();
        final Date today = Date.todaysDate();
        new Settings().setEvaluationDate(today);

        final SimpleQuote spot = new SimpleQuote(0.0);
        final SimpleQuote qRate = new SimpleQuote(0.0);
View Full Code Here

TOP

Related Classes of org.jquantlib.daycounters.DayCounter

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.