Examples of YieldConvention


Examples of com.opengamma.financial.convention.yield.YieldConvention

    }
    return yc;
  }

  public static void validateYieldConvention(final String name) {
    final YieldConvention yc = YieldConventionFactory.INSTANCE.getYieldConvention(name);
    if (yc == null) {
      throw new OpenGammaRuntimeException("Bad value for yieldConvention (" + name + ")");
    }
  }
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

  public YieldConventionBean(String yieldConvention) {
    super(yieldConvention);
  }

  /* package */ YieldConvention toYieldConvention() {
    final YieldConvention yieldConvention = YieldConventionFactory.INSTANCE.getYieldConvention(getName());
    if (yieldConvention == null) {
      throw new OpenGammaRuntimeException("Bad value for yieldConventionBean (" + getName() + ")");
    }
    return yieldConvention;
  }
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

  public static YieldConvention yieldConventionBeanToYieldConvention(final YieldConventionBean yieldConventionBean) {
    if (yieldConventionBean == null) {
      return null;
    }
    final YieldConvention yc = YieldConventionFactory.INSTANCE.getYieldConvention(yieldConventionBean.getName());
    if (yc == null) {
      throw new OpenGammaRuntimeException("Bad value for yieldConventionBean (" + yieldConventionBean.getName() + ")");
    }
    return yc;
  }
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

    final BusinessDayConvention businessDay = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    if (convention.isEOMConvention() == null) {
      throw new OpenGammaRuntimeException("Could not get EOM convention information from " + conventionName);
    }
    final boolean isEOM = convention.isEOMConvention();
    final YieldConvention yieldConvention = security.getYieldConvention();
    if (security.getCouponType().equals("NONE") || security.getCouponType().equals("ZERO COUPON")) { //TODO find where string is
      return new PaymentFixedDefinition(currency, maturityDate, 1);
    }
    if (convention.getBondSettlementDays(firstAccrualDate, maturityDate) == null) {
      throw new OpenGammaRuntimeException("Could not get bond settlement days from " + conventionName);
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

    final BusinessDayConvention businessDay = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    if (convention.isEOMConvention() == null) {
      throw new OpenGammaRuntimeException("Could not get EOM convention information from " + conventionName);
    }
    final boolean isEOM = convention.isEOMConvention();
    final YieldConvention yieldConvention = security.getYieldConvention();
    if (security.getCouponType().equals("NONE") || security.getCouponType().equals("ZERO COUPON")) { //TODO find where string is
      return new PaymentFixedDefinition(currency, maturityDate, 1);
    }
    if (convention.getBondSettlementDays(firstAccrualDate, maturityDate) == null) {
      throw new OpenGammaRuntimeException("Could not get bond settlement days from " + conventionName);
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

    final String issuerName = "issuerName";
    final String issuerType = "issuerType";
    final String issuerDomicile = issuerDomicile();
    final String market = "market";
    final Currency currency = currency();
    final YieldConvention yieldConvention = yieldConvention();
    final Expiry lastTradeDate = expiry();
    final String couponType = "couponType";
    final double couponRate = 1.5;
    final Frequency couponFrequency = frequency();
    final DayCount dayCountConvention = dayCount();
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

    final String issuerName = "issuerName";
    final String issuerType = "issuerType";
    final String issuerDomicile = issuerDomicile();
    final String market = "market";
    final Currency currency = currency();
    final YieldConvention yieldConvention = yieldConvention();
    final Expiry lastTradeDate = expiry();
    final String couponType = "couponType";
    final double couponRate = 1.5;
    final Frequency couponFrequency = frequency();
    final DayCount dayCountConvention = dayCount();
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

    final String issuerName = "issuerName";
    final String issuerType = "issuerType";
    final String issuerDomicile = issuerDomicile();
    final String market = "market";
    final Currency currency = currency();
    final YieldConvention yieldConvention = yieldConvention();
    final Expiry lastTradeDate = expiry();
    final String couponType = "couponType";
    final double couponRate = 1.5;
    final Frequency couponFrequency = frequency();
    final DayCount dayCountConvention = dayCount();
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

      String issuerDomicile = validateAndGetStringField(fieldData, FIELD_CNTRY_ISSUE_ISO);
      String market = validateAndGetStringField(fieldData, FIELD_SECURITY_TYP);
      String currencyStr = validateAndGetStringField(fieldData, FIELD_CRNCY);
      Currency currency = Currency.parse(currencyStr);
      String yieldConventionStr = validateAndGetStringField(fieldData, FIELD_CALC_TYP_DES);
      YieldConvention yieldConvention = YieldConventionFactory.INSTANCE.getYieldConvention(yieldConventionStr);
      if (yieldConvention == null) {
        throw new OpenGammaRuntimeException("Cannot get yield Convention called " + yieldConventionStr);
      }
      String guaranteeType = fieldData.getString(FIELD_GUARANTOR); // bit unsure about this one.
      String maturityStr = validateAndGetStringField(fieldData, FIELD_MATURITY);
View Full Code Here

Examples of com.opengamma.financial.convention.yield.YieldConvention

  @Test
  public void testDatesVsFixed() {
    final BondIborSecurityDefinition bondIbor = BondIborSecurityDefinition.from(MATURITY_DATE, START_ACCRUAL_DATE, IBOR_INDEX, SETTLEMENT_DAYS, DAY_COUNT, BUSINESS_DAY,
        IS_EOM, ISSUER_NAME, CALENDAR);
    final YieldConvention yield = YieldConventionFactory.INSTANCE.getYieldConvention("STREET CONVENTION");
    final BondFixedSecurityDefinition bondFixed = BondFixedSecurityDefinition.from(CUR, MATURITY_DATE, START_ACCRUAL_DATE, IBOR_TENOR, 0.0, SETTLEMENT_DAYS, CALENDAR,
        DAY_COUNT, BUSINESS_DAY, yield, IS_EOM, ISSUER_NAME);
    assertEquals(bondIbor.getNominal(), bondFixed.getNominal());
    for (int loopcpn = 0; loopcpn < bondIbor.getCoupons().getNumberOfPayments(); loopcpn++) {
      assertEquals("Payment " + loopcpn, bondIbor.getCoupons().getNthPayment(loopcpn).getPaymentDate(), bondFixed.getCoupons().getNthPayment(loopcpn).getPaymentDate());
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.