Examples of PriceType


Examples of com.opengamma.analytics.financial.credit.PriceType

    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int n = marketCDSs.length;
    ArgumentChecker.isTrue(n == marketParSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;

    final ISDACompliantCreditCurve baseCurve = _curveBuilder.calibrateCreditCurve(marketCDSs, marketParSpreads, yieldCurve);
    final double basePrice = _pricer.pv(cds, yieldCurve, baseCurve, cdsCoupon, priceType);

    final double[] res = new double[n];
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.PriceType

    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int n = marketCDSs.length;
    ArgumentChecker.isTrue(n == quotedSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;
    final double[] premiums = new double[n];
    Arrays.fill(premiums, dealSpread); // assume the premiums of all CDS are equal

    final double[] puf = _pufConverter.quotedSpreadsToPUF(marketCDSs, premiums, yieldCurve, quotedSpreads);
    final ISDACompliantCreditCurve baseCurve = _curveBuilder.calibrateCreditCurve(marketCDSs, premiums, yieldCurve, puf);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.PriceType

    ArgumentChecker.notNull(yieldCurve, "yieldCurve");
    ArgumentChecker.notNull(bumpType, "bumpType");
    ArgumentChecker.isTrue(Math.abs(fracBumpAmount) > 1e-10, "bump amount too small");
    final int nMarketCDSs = marketCDSs.length;
    ArgumentChecker.isTrue(nMarketCDSs == quotedSpreads.length, "speads length does not match curvePoints");
    final PriceType priceType = PriceType.DIRTY;
    final double[] premiums = new double[nMarketCDSs];
    Arrays.fill(premiums, dealSpread); // assume the premiums of all CDS are equal

    final int nTradeCDSs = cds.length;
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.PriceType

  }

  @Test
  public void testCDSTypes() {
    final CreditDefaultSwapDefinition cds = getLegacyVanillaDefinition();
    final PriceType priceType = PriceType.DIRTY;
    final double pv = CALCULATOR.getPresentValue(cds, CURVE_PROVIDER, VALUATION_DATE, priceType);
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardVanillaDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardFixedRecoveryDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardForwardStartingDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
    assertEquals(pv, CALCULATOR.getPresentValue(getStandardMuniDefinition(), CURVE_PROVIDER, VALUATION_DATE, priceType));
View Full Code Here

Examples of org.apache.xmlbeans.samples.enumeration.schemaenum.pricesummary.PriceType

        PriceSummaryDocument summaryDoc = PriceSummaryDocument.Factory.newInstance();
        PriceSummaryDocument.PriceSummary summary = summaryDoc.addNewPriceSummary();

        // Create <price> elements to hold <item> elements according to their
        // price threshold.
        PriceType priceZero = summary.addNewPrice();
        PriceType priceTen = summary.addNewPrice();
        PriceType priceTwenty = summary.addNewPrice();

        // Set the threshold attribute value for the two new elements.
        priceZero.setThreshold(PriceType.Threshold.BELOW_10_DOLLARS);
        priceTen.setThreshold(PriceType.Threshold.BETWEEN_10_AND_20_DOLLARS);
        priceTwenty.setThreshold(PriceType.Threshold.ABOVE_20_DOLLARS);

        // Loop through the purchase order <line-item> elements. If their
        // <price> child element is between 10.00 and 20.00, add the <line-item>
        // to the <price> element whose threshold is 10.00. For those over 20.00,
        // add them to the <price> element whose threshold is 20.00.

        // There don't happen to be any under 10.00, but handle this case anyway.
        LineItem[] items = po.getLineItemArray();
        for (int i = 0; i < items.length; i++)
        {
            LineItem item = items[i];

            if (item.getPrice() < 10.00)
            {

                ItemType newItem = priceZero.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());

            } else if (item.getPrice() >= 10.00 && item.getPrice() < 20.00)
            {

                ItemType newItem = priceTen.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());

            } else if (item.getPrice() >= 20.00)
            {

                ItemType newItem = priceTwenty.addNewItem();
                newItem.setTitle(item.getDescription());
                newItem.xsetQuantity(item.xgetQuantity());
                newItem.setAmount(item.getPrice());
            }
        }
View Full Code Here

Examples of org.zeroexchange.model.resource.money.PriceType

            protected void onUpdate(AjaxRequestTarget target) {
                BigDecimal amount = amountInput.getConvertedInput();
                amountInput.setModelObject(amount);

                if(priceFragment != null && priceFragment.isVisible()) {
                    PriceType priceType = priceTypeChoice.getModelObject();
                    if(priceType == PriceType.PER_ITEM) {
                        target.add(priceFragment);
                    }
                }
            }
View Full Code Here

Examples of org.zeroexchange.model.resource.money.PriceType

            private PriceType lastPriceType;

            @Override
            protected void onBeforeRender() {
                PriceType priceType = priceTypeChoice.getModelObject();//ConvertedInput();
                setCache(priceType == lastPriceType);
                lastPriceType = priceType;
                super.onBeforeRender();
            }

            @Override
            protected Component createControl(String controlId) {
                PriceType priceType = priceTypeChoice.getModelObject();

                if(priceType != null) {
                    if(PriceType.WORK_EFFORTS == priceType) {
                        // Hours rates choice
                       
View Full Code Here

Examples of org.zeroexchange.model.resource.money.PriceType

            if (userTender instanceof Supply) {
                Supply supply = (Supply) userTender;
                BigDecimal workingHours = supply.getHours();
                data.setWorkingHours(workingHours);
                BigDecimal totalPrice = supply.getTotalPrice();
                PriceType priceType = supply.getPriceType();
                data.setTotalPrice(totalPrice);
                data.setPriceType(priceType);
                data.setSupplyTime(supply.getSupplyTime());
            }
        } else {
View Full Code Here

Examples of org.zeroexchange.model.resource.money.PriceType

            Supply supply = new Supply();
            tender = supply;

            BigDecimal workingHours = tenderData.getWorkingHours();
            supply.setHours(workingHours);
            PriceType priceType = tenderData.getPriceType();
            supply.setPriceType(priceType);
            ZECurrency currencyCode = moneyManager.getDefaultCurrency();
            supply.setCurrency(currencyCode);
            BigDecimal totalPrice = tenderData.getTotalPrice();
            supply.setTotalPrice(totalPrice);
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.