Package name.abuchen.portfolio

Examples of name.abuchen.portfolio.AccountBuilder


    private Client createClient()
    {
        Client client = new Client();

        new AccountBuilder() //
                        .deposit_("2011-12-31", 10000 * Values.Amount.factor()) //
                        .interest("2012-01-01", 230 * Values.Amount.factor()) //
                        .deposit_("2012-01-02", 200 * Values.Amount.factor()) //
                        .interest("2012-01-02", 200 * Values.Amount.factor()) //
                        .withdraw("2012-01-03", 400 * Values.Amount.factor()) //
View Full Code Here


    private Client createClient(double[] delta, long[] transferals)
    {
        Client client = new Client();

        AccountBuilder account = new AccountBuilder();

        DateMidnight time = new DateMidnight("2012-01-01");

        long valuation = 0;
        double quote = 1;
        for (int ii = 0; ii < delta.length; ii++)
        {
            long v = (long) Math.round((double) valuation * (delta[ii] + 1) / quote);
            long d = v - valuation;

            if (transferals[ii] > 0)
                account.deposit_(time, transferals[ii]);
            else if (transferals[ii] < 0)
                account.withdraw(time, Math.abs(transferals[ii]));

            if (v > 0)
                account.interest(time, d);
            else if (v < 0)
                account.fees____(time, Math.abs(d));

            valuation = v + transferals[ii];

            quote = 1 + delta[ii];

            time = time.plusDays(1);
        }

        account.addTo(client);
        return client;
    }
View Full Code Here

    @Test
    public void testThatInterstWithoutInvestmentDoesNotCorruptResultAndIsReported()
    {
        Client client = new Client();
        new AccountBuilder() //
                        .interest("2012-01-02", 100) //
                        .addTo(client);

        ReportingPeriod.FromXtoY period = new ReportingPeriod.FromXtoY(Dates.date(2012, Calendar.JANUARY, 1), //
                        Dates.date(2012, Calendar.JANUARY, 9));
View Full Code Here

    @Test
    public void testThatDepositsOnTheLastDayArePerformanceNeutral()
    {
        Client client = new Client();

        new AccountBuilder() //
                        .deposit_("2012-01-01", 10000) //
                        .interest("2012-01-02", 1000) //
                        .deposit_("2012-01-10", 10000) //
                        .addTo(client);
View Full Code Here

    @Test
    public void testChangesOnFirstDayOfInvestment()
    {
        Client client = new Client();

        new AccountBuilder() //
                        .deposit_("2012-01-01", 10000) //
                        .interest("2012-01-02", 1000) //
                        .addTo(client);

        ReportingPeriod.FromXtoY reportInterval = new ReportingPeriod.FromXtoY(Dates.date(2012, Calendar.JANUARY, 1), //
View Full Code Here

        // create model

        Client client = new Client();

        new AccountBuilder() //
                        .deposit_(startDate, startPrice) //
                        .addTo(client);

        Security security = new SecurityBuilder() //
                        .generatePrices(startPrice, startDate, endDate) //
View Full Code Here

        // create model

        Client client = new Client();

        new AccountBuilder() //
                        .deposit_(startDate, 100 * Values.Amount.factor()) //
                        .interest(startDate.plusDays(10), 10 * Values.Amount.factor()) //
                        .addTo(client);

        Security security = new SecurityBuilder() //
View Full Code Here

        // create model

        Client client = new Client();

        new AccountBuilder() //
                        .deposit_(startDate, 100 * Values.Amount.factor()) //
                        .interest(startDate.plusDays(10), 10 * Values.Amount.factor()) //
                        .addTo(client);

        int startPrice = 50 * Values.Amount.factor();
 
View Full Code Here

        // create model

        Client client = new Client();

        new AccountBuilder() //
                        .deposit_(startDate, 100 * Values.Amount.factor()) //
                        .addTo(client);

        Security security = new Security();
        client.addSecurity(security);
View Full Code Here

                        .addPrice("2012-01-03", 106 * Values.Quote.factor()) //
                        .addPrice("2012-01-08", 112 * Values.Quote.factor()) //
                        .assign(taxonomy, "one", weight) //
                        .addTo(client);

        Account account = new AccountBuilder() //
                        .deposit_("2011-12-31", 10000 * Values.Amount.factor()) //
                        .interest("2012-01-01", 230 * Values.Amount.factor()) //
                        .deposit_("2012-01-02", 200 * Values.Amount.factor()) //
                        .interest("2012-01-02", 200 * Values.Amount.factor()) //
                        .withdraw("2012-01-03", 400 * Values.Amount.factor()) //
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.AccountBuilder

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.