Package org.jquantlib.time

Examples of org.jquantlib.time.Date.clone()


            }
        }

        moreArgs.creditSpread = creditSpread_;
        moreArgs.issueDate = issueDate_.clone();
        moreArgs.settlementDate = settlement.clone();
        moreArgs.settlementDays = settlementDays_;
        moreArgs.redemption = redemption_;
    }

View Full Code Here


        //Now let's get the same holiday list between dateToday and dateAdvanced using isBusinessDay API
        final List<Date> holidayListObtainedUsingCalAPI = new ArrayList<Date>();
        final Date start = dateToday.clone();
        for (; !start.eq(dateAdvanced); start.inc()) {
            if (jointCalendar.isHoliday(start)){
                holidayListObtainedUsingCalAPI.add(start.clone());
            }
        }

        //Essentially both the lists obtained above are same
        if(listOfHoliDays.equals(holidayListObtainedUsingCalAPI)){
View Full Code Here

        final RelinkableHandle<Quote>  handleToStockQuote = new RelinkableHandle<Quote>(stockQuote);

        //Creating black volatility term structure

        //Following is the time axis
        final Date[] dates = { date10.clone(), date15.clone(), date20.clone(), date25.clone(), date30.clone(), date40.clone() };

        //Following is the volatility axis
        final double[] volatilities = {0.1,0.2,0.3,0.4,0.5,0.6};

        //Following is the curve
View Full Code Here

        //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));
View Full Code Here

                }
                discount *= y.discountFactor(settlement, couponDate, lastDate, couponDate);
            } else {
                discount *= y.discountFactor(lastDate, couponDate);
            }
            lastDate = couponDate.clone();

            price += amount * discount;
        }
        return price / faceAmount * 100.0;
    }
View Full Code Here

        //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());
View Full Code Here

        //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.
View Full Code Here

        final List<Date> fixingDates = new ArrayList<Date>(futureFixings);
        final int dt = (int) (360.0 / (futureFixings) + 0.5);
        fixingDates.add(today.clone().addAssign(dt));
        for (int j = 1; j < futureFixings; j++) {
            final Date prevDate = fixingDates.get(j - 1);
            fixingDates.add(prevDate.clone().addAssign(dt));
        }

        QL.info("Average Dates:\n");
        for (final Date d : fixingDates) {
            QL.info(d.toString());
View Full Code Here

                    final Date d = today.clone();
                    final Period THREEMONTH = new Period(3, TimeUnit.Months);
                    d.addAssign(new Period(3, TimeUnit.Months));
                    for (d.addAssign(THREEMONTH); d.le(maturity.lastDate()); d.addAssign(THREEMONTH)) {
                        fixingDates.add(d.clone());
                    }

                    final PricingEngine engine = new AnalyticDiscreteGeometricAveragePriceAsianEngine(process);

                    final DiscreteAveragingAsianOption option = new DiscreteAveragingAsianOption(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.