Package name.abuchen.portfolio

Examples of name.abuchen.portfolio.PortfolioBuilder


        Security security = new SecurityBuilder() //
                        .generatePrices(startPrice, startDate, endDate) //
                        .addTo(client);

        PortfolioBuilder portfolio = new PortfolioBuilder();

        // add some buy transactions
        DateMidnight date = startDate;
        while (date.isBefore(endDate))
        {
            long p = security.getSecurityPrice(date.toDate()).getValue();
            portfolio.inbound_delivery(security, date, 1 * Values.Share.factor(), p);
            date = date.plusDays(20);
        }

        portfolio.addTo(client);

        ReportingPeriod.FromXtoY period = new ReportingPeriod.FromXtoY(startDate.toDate(), endDate.toDate());

        List<Exception> warnings = new ArrayList<Exception>();
        ClientIndex index = PerformanceIndex.forClient(client, period, warnings);
View Full Code Here


        Security a = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1000) //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .buy(a, "2010-01-01", 1000000, 10000) //
                        .sell(a, "2010-01-02", 700000, 12000) //
                        .sell(a, "2010-01-03", 300000, 12000) //
                        .addTo(client);
View Full Code Here

                        .fees____("2012-01-08", 1003 * Values.Amount.factor()) //
                        .dividend("2012-01-08", 100 * Values.Amount.factor(), security) //
                        .assign(taxonomy, "one", weight) //
                        .addTo(client);

        new PortfolioBuilder(account) //
                        .buy(security, "2012-01-01", 50 * Values.Share.factor(), 50 * 101 * Values.Amount.factor()) //
                        .inbound_delivery(security, "2012-01-01", 100 * Values.Share.factor(),
                                        100 * 100 * Values.Amount.factor()) //
                        .sell(security, "2012-01-05", 50 * Values.Share.factor(), 50 * 105 * Values.Amount.factor()) //
                        .addTo(client);
View Full Code Here

        Security d = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1200) //
                        .assign(taxonomy, "equity") //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .inbound_delivery(c, "2010-01-01", 1000000, 12000) //
                        .inbound_delivery(d, "2010-01-01", 1000000, 12000) //
                        .addTo(client);
View Full Code Here

                        .addPrice("2010-01-01", 1000) //
                        .assign(taxonomy, "debt", Classification.ONE_HUNDRED_PERCENT / 2) //
                        .assign(taxonomy, "equity", Classification.ONE_HUNDRED_PERCENT / 2) //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .addTo(client);

        PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
        assertNotNull(snapshot);
View Full Code Here

                        .addPrice("2010-01-01", 1000) //
                        .assign(taxonomy, "cat1", Classification.ONE_HUNDRED_PERCENT / 2) //
                        .assign(taxonomy, "cat2", Classification.ONE_HUNDRED_PERCENT / 2) //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .addTo(client);

        PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
        assertNotNull(snapshot);
View Full Code Here

        Security a = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1000) //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .addTo(client);

        PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
        assertNotNull(snapshot);
View Full Code Here

        Security a = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1000) //
                        .assign(taxonomy, "debt", Classification.ONE_HUNDRED_PERCENT / 2) //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .addTo(client);

        PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
        assertNotNull(snapshot);
View Full Code Here

        Client client = new Client();

        Security security = new SecurityBuilder() //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .buy(security, "2010-01-01", 109 * Values.Share.factor(), 314920) //
                        .sell(security, "2010-02-01", 15 * Values.Share.factor(), 53150) //
                        .buy(security, "2010-03-01", 52 * Values.Share.factor(), 168492) //
                        .buy(security, "2010-03-01", 32 * Values.Share.factor(), 95930) //
                        .addTo(client);
View Full Code Here

        Client client = new Client();

        Security security = new SecurityBuilder() //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .buy(security, "2010-01-01", 10 * Values.Share.factor(), 1) //
                        .sell(security, "2010-02-01", 3 * Values.Share.factor(), 1) //
                        .sell(security, "2010-03-01", 3 * Values.Share.factor(), 1) //
                        .sell(security, "2010-03-01", 4 * Values.Share.factor(), 1) //
                        .addTo(client);
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.PortfolioBuilder

Copyright © 2018 www.massapicom. 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.