Examples of addPrice()


Examples of name.abuchen.portfolio.model.Security.addPrice()

    {
        Client client = new Client();

        Security security = new Security();
        security.addPrice(new SecurityPrice(Dates.date(2010, Calendar.JANUARY, 1), 10000));
        security.addPrice(new SecurityPrice(Dates.date(2011, Calendar.JUNE, 1), 11000));
        client.addSecurity(security);

        Portfolio portfolio = new Portfolio();
        portfolio.addTransaction(new PortfolioTransaction(Dates.date(2010, Calendar.JANUARY, 1), security,
                        PortfolioTransaction.Type.BUY, 1000000, 100, 0, 0));
View Full Code Here

Examples of name.abuchen.portfolio.model.Security.addPrice()

        // if the date changed, the prices must be reordered --> binary search
        if (newValue instanceof Date)
        {
            SecurityPrice price = (SecurityPrice) element;
            security.removePrice(price);
            security.addPrice(price);
        }

        securities.refresh(security);
        prices.refresh(element);
        latest.setInput(security);
View Full Code Here

Examples of name.abuchen.portfolio.model.Security.addPrice()

                        return;

                    SecurityPrice price = new SecurityPrice();
                    price.setTime(Dates.today());

                    security.addPrice(price);

                    markDirty();

                    prices.setInput(security.getPrices());
                    latest.setInput(security);
View Full Code Here

Examples of name.abuchen.portfolio.model.Security.addPrice()

        fiveYearsAgo.add(Calendar.YEAR, -5);

        Calendar cal = feed.caculateStart(security);
        assertThat(cal, equalTo(fiveYearsAgo));

        security.addPrice(new SecurityPrice(Dates.today(), 100));
        cal = feed.caculateStart(security);
        assertThat(cal.getTime(), equalTo(Dates.today()));
    }

    @Test
View Full Code Here

Examples of name.abuchen.portfolio.model.Security.addPrice()

            Long amount = convertAmount(Messages.CSVColumn_Quote, rawValues, field2column);
            if (amount == null)
                throw new ParseException(
                                MessageFormat.format(Messages.CSVImportMissingField, Messages.CSVColumn_Quote), 0);

            security.addPrice(new SecurityPrice(date, Math.abs(amount)));
        }
    }

    /* package */static class SecurityDef extends CSVImportDefinition
    {
View Full Code Here

Examples of org.internna.ossmoney.model.Investment.addPrice()

      UserDetails user = UserDetails.findCurrentUser();
      Investment investment = Investment.findInvestment(investmentId);
      InvestmentPrice price = InvestmentPrice.findInvestmentPrice(priceId);
      if (price == null) {
        price = new InvestmentPrice();
        investment.addPrice(price);
      }
      if ((investment != null) && investment.belongsTo(user) && price.belongsTo(investment)) {
        price.setPrice(amount);
        price.setUpdateTime(operationDate);
        if (price.getId() != null) {
View Full Code Here

Examples of org.objectweb.speedo.pobjects.detach.Share.addPrice()

    SharePrice price = copyOfShare.getPrice(12,2004,11);
    if (price != null) {
        price.setPrice(new BigDecimal(99000));
    }
    SharePrice newSp = new SharePrice(31, 2006, 11, new BigDecimal(31000));
    copyOfShare.addPrice(newSp);
    try {
      logger.log(BasicLevel.DEBUG, "share price updated");
      pm.currentTransaction().begin();
      Share attachedShare = (Share) pm.makePersistent((Object)copyOfShare);
      pm.currentTransaction().commit();
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.