Package org.jquantlib

Examples of org.jquantlib.Settings


    @Test
    public void testFdAmericanGreeks() {
        QL.info("Testing finite-differences dividend American option greeks...");
        final Date today = Date.todaysDate();
        new Settings().setEvaluationDate(today);

        /* @Integer */ final int lengths[] = { 1, 2 };

        for (final int length : lengths) {
            final Date exDate = today.add(new Period(length, TimeUnit.Years));
View Full Code Here


    public void testFdEuropeanDegenerate() {

        QL.info("Testing degenerate finite-differences dividend European option...");

        final Date today = new Date(27, Month.February, 2005);
        new Settings().setEvaluationDate(today);
        final Date exDate = new Date(13, Month.April, 2005);
        final Exercise exercise = new EuropeanExercise(exDate);
        testFdDegenerate(FDDividendEuropeanEngine.class, today, exercise);
    }
View Full Code Here

    public void testFdAmericanDegenerate() {

        QL.info("Testing degenerate finite-differences dividend American option...");

        final Date today = new Date(27, Month.February,2005);
        new Settings().setEvaluationDate(today);
        final Date exDate = new Date(13, Month.April, 2005);
        final Exercise exercise = new AmericanExercise(today, exDate);
        testFdDegenerate(FDDividendAmericanEngine.class, today, exercise);
    }
View Full Code Here

        //
        // private methods
        //

        private boolean extraSafetyChecks() {
            if (new Settings().isExtraSafetyChecks()) {
                for (int i=0; i<vx.size()-1; i++) {
                    if (vx.get(i) > vx.get(i+1))
                        return false;
                }
            }
View Full Code Here

        QL.require(gearing != 0 , "Null gearing not allowed");

        if (dayCounter_.empty())
            dayCounter_ = index.dayCounter();

        Date evaluationDate = new Settings().evaluationDate();
        this.index_.addObserver(this);
        evaluationDate.addObserver(this);
    }
View Full Code Here

            final Date referenceDate) {
      exerciseDate_ = d;
      dc_ = dc;
      isFloating_ = referenceDate.isNull();
      if (isFloating_) {
        final Settings settings = new Settings();
        settings.evaluationDate().addObserver(this);
        reference_ = settings.evaluationDate();
      } else
            reference_ = referenceDate;
      initializeExerciseTime();
    }
View Full Code Here

    //

    @Override
    public void update() {
        if (isFloating_) {
            final Settings settings = new Settings();
            reference_ = settings.evaluationDate();
            initializeExerciseTime();
        }

    }
View Full Code Here

     * <p>
     * This should be the only place in the code that is affected
     * directly by {@link Settings#isTodaysPayments()}
     */
    public boolean hasOccurred(final Date d) /* @ReadOnly */ {
        return hasOccurred(d, new Settings().isTodaysPayments());
    }
View Full Code Here

            final Frequency frequency, final Date settlementDate, final double tolerance, final int maxIterations,
            final double guess) {

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

        // depending on the sign of the market price, check that cash
        // flows of the opposite sign have been specified (otherwise
        // IRR is nonsensical.)
View Full Code Here

     */
    public double duration(final Leg leg, final InterestRate y, final Duration duration, final Date settlementDate) {

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

        switch (duration) {
        case Simple:
            return simpleDuration(leg, y, date);
View Full Code Here

TOP

Related Classes of org.jquantlib.Settings

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.