Examples of BondFixedTransactionDefinition


Examples of com.opengamma.analytics.financial.instrument.bond.BondFixedTransactionDefinition

    ArgumentChecker.notNull(date, "Reference date");
    final int quantity = (int) Math.round(notional / _security.getNominal().getNthPayment(0).getReferenceAmount());
    final ZonedDateTime settleDate = ScheduleCalculator.getAdjustedDate(date, _security.getSettlementDays(), _security.getCalendar());
    final double accruedIntrerest = _security.accruedInterest(settleDate);
    final double dirtyPrice = marketQuote + accruedIntrerest;
    return new BondFixedTransactionDefinition(_security, quantity, settleDate, dirtyPrice);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.bond.BondFixedTransactionDefinition

    final ZonedDateTime settlementDate = trade.getTradeDate().atTime(trade.getTradeTime()).atZoneSameInstant(ZoneOffset.UTC); //TODO get the real time zone
    if (trade.getPremium() == null) {
      throw new OpenGammaRuntimeException("Trade premium should not be null.");
    }
    final double price = trade.getPremium().doubleValue();
    return new BondFixedTransactionDefinition(bond, quantity, settlementDate, price);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.instrument.bond.BondFixedTransactionDefinition

    final Trade trade = target.getTrade();
    final HolidaySource holidaySource = OpenGammaExecutionContext.getHolidaySource(context);
    final ConventionBundleSource conventionSource = OpenGammaExecutionContext.getConventionBundleSource(context);
    final RegionSource regionSource = OpenGammaExecutionContext.getRegionSource(context);
    BondTradeConverter visitor = new BondTradeConverter(new BondSecurityConverter(holidaySource, conventionSource, regionSource));
    final BondFixedTransactionDefinition definition = visitor.convert(trade);
    BondFixedTransaction derivative = definition.toDerivative(date, riskFreeCurveName, creditCurveName);
    return CALCULATOR.presentValueFromCleanPrice(derivative, data, price);
  }
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.