Examples of BarrierType


Examples of com.opengamma.analytics.financial.model.option.definition.Barrier.BarrierType

      final double strike = SPOT * (0.8 + i * 0.1);
      for (int j = 0; j < 5; j++) {
        final double h = SPOT * (0.9 + j * 0.05);
        for (int k = 0; k < 2; k++) {
          final boolean isCall = k == 0;
          final BarrierType bt = SPOT > h ? BarrierType.DOWN : BarrierType.UP;
        final double anPrice = ANAL_PRICER.getPrice(new EuropeanVanillaOption(strike, EXPIRY, isCall),
            new Barrier(KnockType.OUT, bt, ObservationType.CONTINUOUS, h), REBATE, SPOT, B, R, SIGMA);
        final double fdPrice = PRICER.outBarrier(SPOT, h, strike, EXPIRY, R, B, SIGMA, isCall, REBATE);

        if (PRINT) {
View Full Code Here

Examples of com.opengamma.analytics.financial.model.option.definition.Barrier.BarrierType

      final double strike = SPOT * (0.9 + i * 0.1);
      for (int j = 0; j < 5; j++) {
        final double h = SPOT * (0.9 + j * 0.05);
        for (int k = 0; k < 2; k++) {
          final boolean isCall = k == 0;
          final BarrierType bt = SPOT > h ? BarrierType.DOWN : BarrierType.UP;
        final double anPrice = ANAL_PRICER.getPrice(new EuropeanVanillaOption(strike, EXPIRY, isCall), new Barrier(KnockType.IN, bt, ObservationType.CONTINUOUS, h), REBATE, SPOT, B, R, SIGMA);
        final double fdPrice = PRICER.inBarrier(SPOT, h, strike, EXPIRY, R, B, SIGMA, isCall, REBATE);

        if (PRINT) {
          final String call = isCall ? "call" : "put ";
View Full Code Here

Examples of com.opengamma.financial.security.option.BarrierType

    if (fxRate == null) {
      return null;
    }
    final double callAmount = NOTIONAL * fxRate;
    final String dateString = settlementDate.toString(DATE_FORMATTER);
    final BarrierType barrierType = bundle._up ? BarrierType.UP : BarrierType.DOWN;
    final BarrierDirection barrierDirection = BarrierDirection.KNOCK_IN;
    final MonitoringType monitoringType = MonitoringType.CONTINUOUS;
    final SamplingFrequency samplingFrequency = SamplingFrequency.DAILY_CLOSE;
    final boolean invertBarrierLevel = !CurrencyPair.of(putCurrency, callCurrency).equals(getCurrencyPair(putCurrency, callCurrency));
    // so if UP and ccy convention order, multiple, if UP and inverted ccy order, divide, if DOWN and ccy convention order multiply, if DOWN and inverted ccy order, divide.
View Full Code Here

Examples of com.opengamma.financial.security.option.BarrierType

    final ExternalId underlyingId = createEquitySecurity().getExternalIdBundle().getExternalId(ExternalSchemes.BLOOMBERG_TICKER);
    final ExerciseType exerciseType = exerciseType();
    final Expiry expiry = expiry();
    final double pointValue = 0;
    final String exchange = exchange();
    final BarrierType barrierType = barrierType();
    final BarrierDirection barrierDirection = barrierDirection();
    final MonitoringType monitoringType = monitoringType();
    final SamplingFrequency samplingFrequency = samplingFrequency();
    final double barrierLevel = 0;
    final EquityBarrierOptionSecurity security = new EquityBarrierOptionSecurity(optionType, strike, currency, underlyingId, exerciseType, expiry, pointValue, exchange, barrierType,
View Full Code Here

Examples of com.opengamma.financial.security.option.BarrierType

    final Currency callCurrency = differentCurrency(putCurrency);
    final double putAmount = 0;
    final double callAmount = 0;
    final Expiry expiry = expiry();
    final ZonedDateTime settlementDate = expiry.getExpiry();
    final BarrierType barrierType = barrierType();
    final BarrierDirection barrierDirection = barrierDirection();
    final MonitoringType monitoringType = monitoringType();
    final SamplingFrequency samplingFrequency = samplingFrequency();
    final double barrierLevel = 0;
    final boolean isLong = bool();
View Full Code Here

Examples of com.opengamma.financial.security.option.BarrierType

      final double smoothingFullWidth, final double overhedge) {

    final Set<EquityIndexOption> vanillas = new HashSet<>();
    // Unpack the barrier security
    final BarrierDirection bInOut = barrierOption.getBarrierDirection(); //   KNOCK_IN, KNOCK_OUT,
    final BarrierType bUpDown = barrierOption.getBarrierType(); //   UP, DOWN, DOUBLE
    final double strike = barrierOption.getStrike();
    final double barrier = barrierOption.getBarrierLevel();
    final ZonedDateTime expiry = barrierOption.getExpiry().getExpiry();
    final double ttm = TimeCalculator.getTimeBetween(valuation, expiry);
    final Currency ccy = barrierOption.getCurrency();
View Full Code Here

Examples of com.opengamma.financial.security.option.BarrierType

    final ZonedDateTime expiry = barrierSec.getExpiry().getExpiry();
    final ZonedDateTime settlement = barrierSec.getSettlementDate();

    // The barrier has four types
    final BarrierDirection bInOut = barrierSec.getBarrierDirection(); //   KNOCK_IN, KNOCK_OUT,
    final BarrierType bUpDown = barrierSec.getBarrierType(); //   UP, DOWN, DOUBLE
    final double barrier = barrierSec.getBarrierLevel();

    // Put and Call Amounts, along with market convention for quote/base ccy define the strike, notional, and call/put interpretation
    final ValueRequirement desiredValue = desiredValues.iterator().next();
    final String putCurveName = desiredValue.getConstraint(PUT_CURVE);
View Full Code Here

Examples of org.jquantlib.instruments.BarrierType

        QL.require(a.payoff instanceof PlainVanillaPayoff, NON_PLAIN_PAYOFF_GIVEN); // QA:[RG]::verified // TODO: message
        this.payoff = (PlainVanillaPayoff)a.payoff;
        QL.require(payoff.strike()>0.0 , STRIKE_MUST_BE_POSITIVE); // QA:[RG]::verified // TODO: message

        final double strike = payoff.strike();
        final BarrierType barrierType = a.barrierType;

        switch (payoff.optionType()) {
            case Call:
                switch (barrierType) {
                    case DownIn:
View Full Code Here

Examples of org.jquantlib.instruments.BarrierType

            final Date today = new Date(29, Month.May, 2006);
            new Settings().setEvaluationDate(today);

            //the option to replicate
            final BarrierType barrierType = BarrierType.DownOut;
            final double barrier = 70.0;
            final double rebate = 0.0;
            final Option.Type type = Option.Type.Put;
            final double underlyingValue = 100;
            final Handle<SimpleQuote> underlying = new Handle<SimpleQuote>(new SimpleQuote(underlyingValue));
View Full Code Here

Examples of org.jquantlib.instruments.BarrierType

        QL.require(a.payoff instanceof PlainVanillaPayoff, NON_PLAIN_PAYOFF_GIVEN); // TODO: message
        this.payoff = (PlainVanillaPayoff)a.payoff;
        QL.require(payoff.strike()>0.0 , STRIKE_MUST_BE_POSITIVE); // TODO: message

        final double strike = payoff.strike();
        final BarrierType barrierType = a.barrierType;

        switch (payoff.optionType()) {
            case Call:
                switch (barrierType) {
                    case DownIn:
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.