Search in sources :

Example 41 with SecurityPrice

use of name.abuchen.portfolio.model.SecurityPrice in project portfolio by buchen.

the class SecuritiesChart method updateChart.

private void updateChart() {
    chart.setRedraw(false);
    try {
        // delete all line series (quotes + possibly moving average)
        ISeries[] series = chart.getSeriesSet().getSeries();
        for (ISeries s : series) chart.getSeriesSet().deleteSeries(s.getId());
        chart.clearMarkerLines();
        customPaintListeners.clear();
        customTooltipEvents.clear();
        if (security == null || security.getPrices().isEmpty()) {
            // $NON-NLS-1$
            chart.getTitle().setText(security == null ? "..." : security.getName());
            chart.redraw();
            return;
        }
        chart.getTitle().setText(security.getName());
        boolean showAreaRelativeToFirstQuote = chartConfig.contains(ChartDetails.CLOSING) || chartConfig.contains(ChartDetails.PURCHASEPRICE);
        List<SecurityPrice> prices = security.getPricesIncludingLatest();
        int index;
        LocalDate[] dates;
        double[] values;
        double[] valuesRelative;
        double[] valuesRelativePositive;
        double[] valuesRelativeNegative;
        double[] valuesZeroLine;
        double firstQuote = 0;
        if (chartPeriod == null) {
            index = 0;
            dates = new LocalDate[prices.size()];
            values = new double[prices.size()];
            valuesRelative = new double[prices.size()];
            valuesRelativePositive = new double[prices.size()];
            valuesRelativeNegative = new double[prices.size()];
            valuesZeroLine = new double[prices.size()];
        } else {
            index = Collections.binarySearch(prices, new SecurityPrice(chartPeriod, 0), new SecurityPrice.ByDate());
            if (index == -1) {
                index = 0;
            } else {
                index = Math.abs(index);
            }
            if (index >= prices.size()) {
                // no data available
                chart.redraw();
                return;
            }
            dates = new LocalDate[prices.size() - index];
            values = new double[prices.size() - index];
            valuesRelative = new double[prices.size() - index];
            valuesRelativePositive = new double[prices.size() - index];
            valuesRelativeNegative = new double[prices.size() - index];
            valuesZeroLine = new double[prices.size() - index];
        }
        SecurityPrice p2 = prices.get(index);
        if (!chartConfig.contains(ChartDetails.PURCHASEPRICE)) {
            firstQuote = (p2.getValue() / Values.Quote.divider());
        } else {
            Optional<Double> purchasePrice = getLatestPurchasePrice();
            if (purchasePrice.isPresent())
                firstQuote = purchasePrice.get();
            else
                showAreaRelativeToFirstQuote = false;
        }
        addChartMarkerBackground();
        for (int ii = 0; index < prices.size(); index++, ii++) {
            SecurityPrice p = prices.get(index);
            dates[ii] = p.getDate();
            values[ii] = p.getValue() / Values.Quote.divider();
            if (showAreaRelativeToFirstQuote) {
                valuesRelative[ii] = (p.getValue() / Values.Quote.divider()) - firstQuote;
                valuesZeroLine[ii] = 0;
                if (valuesRelative[ii] >= 0) {
                    valuesRelativePositive[ii] = valuesRelative[ii];
                    valuesRelativeNegative[ii] = 0;
                } else {
                    valuesRelativePositive[ii] = 0;
                    valuesRelativeNegative[ii] = valuesRelative[ii];
                }
            }
        }
        Date[] javaDates = TimelineChart.toJavaUtilDate(dates);
        if (showAreaRelativeToFirstQuote) {
            ILineSeries lineSeries2ndNegative = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, // $NON-NLS-1$
            Messages.LabelChartDetailClosingIndicator + "Negative");
            lineSeries2ndNegative.setSymbolType(PlotSymbolType.NONE);
            lineSeries2ndNegative.setYAxisId(1);
            configureSeriesPainter(lineSeries2ndNegative, javaDates, valuesRelativeNegative, colorAreaNegative, 1, LineStyle.SOLID, true, false);
            ILineSeries lineSeries2ndPositive = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, // $NON-NLS-1$
            Messages.LabelChartDetailClosingIndicator + "Positive");
            lineSeries2ndPositive.setSymbolType(PlotSymbolType.NONE);
            lineSeries2ndPositive.setYAxisId(1);
            configureSeriesPainter(lineSeries2ndPositive, javaDates, valuesRelativePositive, colorAreaPositive, 1, LineStyle.SOLID, true, false);
        }
        ILineSeries lineSeries = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, Messages.ColumnQuote);
        lineSeries.setSymbolType(PlotSymbolType.NONE);
        configureSeriesPainter(lineSeries, javaDates, values, colorQuote, 2, LineStyle.SOLID, !showAreaRelativeToFirstQuote, false);
        chart.adjustRange();
        addChartMarkerForeground();
        chart.adjustRange();
        IAxis yAxis1st = chart.getAxisSet().getYAxis(0);
        IAxis yAxis2nd = chart.getAxisSet().getYAxis(1);
        yAxis2nd.setRange(new Range(yAxis1st.getRange().lower - firstQuote, yAxis1st.getRange().upper - firstQuote));
    } finally {
        chart.setRedraw(true);
        chart.redraw();
    }
}
Also used : ILineSeries(org.swtchart.ILineSeries) Range(org.swtchart.Range) ISeries(org.swtchart.ISeries) LocalDate(java.time.LocalDate) Point(org.eclipse.swt.graphics.Point) Date(java.util.Date) LocalDate(java.time.LocalDate) IAxis(org.swtchart.IAxis) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice)

Example 42 with SecurityPrice

use of name.abuchen.portfolio.model.SecurityPrice in project portfolio by buchen.

the class SecuritiesTable method addColumnDateOfLatestPrice.

private // NOSONAR
void addColumnDateOfLatestPrice() {
    Column column;
    // $NON-NLS-1$
    column = new Column("9", Messages.ColumnLatestDate, SWT.LEFT, 80);
    column.setMenuLabel(Messages.ColumnLatestDate_MenuLabel);
    column.setLabelProvider(new ColumnLabelProvider() {

        @Override
        public String getText(Object element) {
            SecurityPrice latest = ((Security) element).getSecurityPrice(LocalDate.now());
            return latest != null ? Values.Date.format(latest.getDate()) : null;
        }

        @Override
        public Color getBackground(Object element) {
            Security security = (Security) element;
            SecurityPrice latest = security.getSecurityPrice(LocalDate.now());
            if (latest == null)
                return null;
            String feed = security.getLatestFeed() != null ? security.getLatestFeed() : security.getFeed();
            if (QuoteFeed.MANUAL.equals(feed))
                return null;
            LocalDate sevenDaysAgo = LocalDate.now().minusDays(7);
            return latest.getDate().isBefore(sevenDaysAgo) ? Colors.WARNING : null;
        }
    });
    column.setSorter(ColumnViewerSorter.create((o1, o2) -> {
        SecurityPrice p1 = ((Security) o1).getSecurityPrice(LocalDate.now());
        SecurityPrice p2 = ((Security) o2).getSecurityPrice(LocalDate.now());
        if (p1 == null)
            return p2 == null ? 0 : -1;
        if (p2 == null)
            return 1;
        return p1.getDate().compareTo(p2.getDate());
    }));
    support.addColumn(column);
}
Also used : ReportingPeriodColumnOptions(name.abuchen.portfolio.ui.util.viewers.ReportingPeriodColumnOptions) Client(name.abuchen.portfolio.model.Client) TableViewer(org.eclipse.jface.viewers.TableViewer) BiFunction(java.util.function.BiFunction) DND(org.eclipse.swt.dnd.DND) SecurityDragListener(name.abuchen.portfolio.ui.dnd.SecurityDragListener) CurrencyColumn(name.abuchen.portfolio.ui.views.columns.CurrencyColumn) ModificationListener(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport.ModificationListener) SecurityTransactionDialog(name.abuchen.portfolio.ui.dialogs.transactions.SecurityTransactionDialog) StockSplitWizard(name.abuchen.portfolio.ui.wizards.splits.StockSplitWizard) Composite(org.eclipse.swt.widgets.Composite) AbstractFinanceView(name.abuchen.portfolio.ui.AbstractFinanceView) KeyEvent(org.eclipse.swt.events.KeyEvent) Factory(name.abuchen.portfolio.online.Factory) ReportingPeriod(name.abuchen.portfolio.snapshot.ReportingPeriod) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Separator(org.eclipse.jface.action.Separator) SecurityTransferDialog(name.abuchen.portfolio.ui.dialogs.transactions.SecurityTransferDialog) MenuManager(org.eclipse.jface.action.MenuManager) Security(name.abuchen.portfolio.model.Security) Display(org.eclipse.swt.widgets.Display) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) Collectors(java.util.stream.Collectors) ColumnEditingSupport(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport) Transfer(org.eclipse.swt.dnd.Transfer) ShowHideColumnHelper(name.abuchen.portfolio.ui.util.viewers.ShowHideColumnHelper) OptionLabelProvider(name.abuchen.portfolio.ui.util.viewers.OptionLabelProvider) List(java.util.List) UpdateQuotesJob(name.abuchen.portfolio.ui.UpdateQuotesJob) TaxonomyColumn(name.abuchen.portfolio.ui.views.columns.TaxonomyColumn) Colors(name.abuchen.portfolio.ui.util.Colors) EditSecurityDialog(name.abuchen.portfolio.ui.wizards.security.EditSecurityDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) AttributeColumn(name.abuchen.portfolio.ui.views.columns.AttributeColumn) LocalDate(java.time.LocalDate) SWT(org.eclipse.swt.SWT) Watchlist(name.abuchen.portfolio.model.Watchlist) AccountTransactionDialog(name.abuchen.portfolio.ui.dialogs.transactions.AccountTransactionDialog) SecurityTransfer(name.abuchen.portfolio.ui.dnd.SecurityTransfer) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) QuoteFeed(name.abuchen.portfolio.online.QuoteFeed) BooleanEditingSupport(name.abuchen.portfolio.ui.util.viewers.BooleanEditingSupport) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) PortfolioTransaction(name.abuchen.portfolio.model.PortfolioTransaction) Values(name.abuchen.portfolio.money.Values) NoteColumn(name.abuchen.portfolio.ui.views.columns.NoteColumn) BookmarkMenu(name.abuchen.portfolio.ui.util.BookmarkMenu) Images(name.abuchen.portfolio.ui.Images) Image(org.eclipse.swt.graphics.Image) Function(java.util.function.Function) TableColumnLayout(org.eclipse.jface.layout.TableColumnLayout) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) IsinColumn(name.abuchen.portfolio.ui.views.columns.IsinColumn) Messages(name.abuchen.portfolio.ui.Messages) StringEditingSupport(name.abuchen.portfolio.ui.util.viewers.StringEditingSupport) Taxonomy(name.abuchen.portfolio.model.Taxonomy) NumberColorLabelProvider(name.abuchen.portfolio.ui.util.viewers.NumberColorLabelProvider) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Shell(org.eclipse.swt.widgets.Shell) AccountTransaction(name.abuchen.portfolio.model.AccountTransaction) Column(name.abuchen.portfolio.ui.util.viewers.Column) ColumnViewerSorter(name.abuchen.portfolio.ui.util.viewers.ColumnViewerSorter) Action(org.eclipse.jface.action.Action) LatestSecurityPrice(name.abuchen.portfolio.model.LatestSecurityPrice) OpenDialogAction(name.abuchen.portfolio.ui.dialogs.transactions.OpenDialogAction) Color(org.eclipse.swt.graphics.Color) IMenuManager(org.eclipse.jface.action.IMenuManager) Dialog(org.eclipse.jface.dialogs.Dialog) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice) Menu(org.eclipse.swt.widgets.Menu) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) CurrencyColumn(name.abuchen.portfolio.ui.views.columns.CurrencyColumn) TaxonomyColumn(name.abuchen.portfolio.ui.views.columns.TaxonomyColumn) AttributeColumn(name.abuchen.portfolio.ui.views.columns.AttributeColumn) NoteColumn(name.abuchen.portfolio.ui.views.columns.NoteColumn) IsinColumn(name.abuchen.portfolio.ui.views.columns.IsinColumn) Column(name.abuchen.portfolio.ui.util.viewers.Column) Color(org.eclipse.swt.graphics.Color) LatestSecurityPrice(name.abuchen.portfolio.model.LatestSecurityPrice) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice) Security(name.abuchen.portfolio.model.Security) LocalDate(java.time.LocalDate)

Example 43 with SecurityPrice

use of name.abuchen.portfolio.model.SecurityPrice in project portfolio by buchen.

the class SecuritiesTable method addColumnLatestPrice.

private // NOSONAR
void addColumnLatestPrice() {
    // $NON-NLS-1$
    Column column = new Column("4", Messages.ColumnLatest, SWT.RIGHT, 60);
    column.setMenuLabel(Messages.ColumnLatest_MenuLabel);
    column.setLabelProvider(new ColumnLabelProvider() {

        @Override
        public String getText(Object e) {
            Security security = (Security) e;
            SecurityPrice latest = security.getSecurityPrice(LocalDate.now());
            if (latest == null)
                return null;
            if (security.getCurrencyCode() == null)
                return Values.Quote.format(latest.getValue());
            else
                return Values.Quote.format(security.getCurrencyCode(), latest.getValue(), getClient().getBaseCurrency());
        }
    });
    column.setSorter(ColumnViewerSorter.create((o1, o2) -> {
        SecurityPrice p1 = ((Security) o1).getSecurityPrice(LocalDate.now());
        SecurityPrice p2 = ((Security) o2).getSecurityPrice(LocalDate.now());
        if (p1 == null)
            return p2 == null ? 0 : -1;
        if (p2 == null)
            return 1;
        long v1 = p1.getValue();
        long v2 = p2.getValue();
        return v1 > v2 ? 1 : v1 == v2 ? 0 : -1;
    }));
    support.addColumn(column);
}
Also used : ReportingPeriodColumnOptions(name.abuchen.portfolio.ui.util.viewers.ReportingPeriodColumnOptions) Client(name.abuchen.portfolio.model.Client) TableViewer(org.eclipse.jface.viewers.TableViewer) BiFunction(java.util.function.BiFunction) DND(org.eclipse.swt.dnd.DND) SecurityDragListener(name.abuchen.portfolio.ui.dnd.SecurityDragListener) CurrencyColumn(name.abuchen.portfolio.ui.views.columns.CurrencyColumn) ModificationListener(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport.ModificationListener) SecurityTransactionDialog(name.abuchen.portfolio.ui.dialogs.transactions.SecurityTransactionDialog) StockSplitWizard(name.abuchen.portfolio.ui.wizards.splits.StockSplitWizard) Composite(org.eclipse.swt.widgets.Composite) AbstractFinanceView(name.abuchen.portfolio.ui.AbstractFinanceView) KeyEvent(org.eclipse.swt.events.KeyEvent) Factory(name.abuchen.portfolio.online.Factory) ReportingPeriod(name.abuchen.portfolio.snapshot.ReportingPeriod) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Separator(org.eclipse.jface.action.Separator) SecurityTransferDialog(name.abuchen.portfolio.ui.dialogs.transactions.SecurityTransferDialog) MenuManager(org.eclipse.jface.action.MenuManager) Security(name.abuchen.portfolio.model.Security) Display(org.eclipse.swt.widgets.Display) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) Collectors(java.util.stream.Collectors) ColumnEditingSupport(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport) Transfer(org.eclipse.swt.dnd.Transfer) ShowHideColumnHelper(name.abuchen.portfolio.ui.util.viewers.ShowHideColumnHelper) OptionLabelProvider(name.abuchen.portfolio.ui.util.viewers.OptionLabelProvider) List(java.util.List) UpdateQuotesJob(name.abuchen.portfolio.ui.UpdateQuotesJob) TaxonomyColumn(name.abuchen.portfolio.ui.views.columns.TaxonomyColumn) Colors(name.abuchen.portfolio.ui.util.Colors) EditSecurityDialog(name.abuchen.portfolio.ui.wizards.security.EditSecurityDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) AttributeColumn(name.abuchen.portfolio.ui.views.columns.AttributeColumn) LocalDate(java.time.LocalDate) SWT(org.eclipse.swt.SWT) Watchlist(name.abuchen.portfolio.model.Watchlist) AccountTransactionDialog(name.abuchen.portfolio.ui.dialogs.transactions.AccountTransactionDialog) SecurityTransfer(name.abuchen.portfolio.ui.dnd.SecurityTransfer) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) QuoteFeed(name.abuchen.portfolio.online.QuoteFeed) BooleanEditingSupport(name.abuchen.portfolio.ui.util.viewers.BooleanEditingSupport) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) PortfolioTransaction(name.abuchen.portfolio.model.PortfolioTransaction) Values(name.abuchen.portfolio.money.Values) NoteColumn(name.abuchen.portfolio.ui.views.columns.NoteColumn) BookmarkMenu(name.abuchen.portfolio.ui.util.BookmarkMenu) Images(name.abuchen.portfolio.ui.Images) Image(org.eclipse.swt.graphics.Image) Function(java.util.function.Function) TableColumnLayout(org.eclipse.jface.layout.TableColumnLayout) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) IsinColumn(name.abuchen.portfolio.ui.views.columns.IsinColumn) Messages(name.abuchen.portfolio.ui.Messages) StringEditingSupport(name.abuchen.portfolio.ui.util.viewers.StringEditingSupport) Taxonomy(name.abuchen.portfolio.model.Taxonomy) NumberColorLabelProvider(name.abuchen.portfolio.ui.util.viewers.NumberColorLabelProvider) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Shell(org.eclipse.swt.widgets.Shell) AccountTransaction(name.abuchen.portfolio.model.AccountTransaction) Column(name.abuchen.portfolio.ui.util.viewers.Column) ColumnViewerSorter(name.abuchen.portfolio.ui.util.viewers.ColumnViewerSorter) Action(org.eclipse.jface.action.Action) LatestSecurityPrice(name.abuchen.portfolio.model.LatestSecurityPrice) OpenDialogAction(name.abuchen.portfolio.ui.dialogs.transactions.OpenDialogAction) Color(org.eclipse.swt.graphics.Color) IMenuManager(org.eclipse.jface.action.IMenuManager) Dialog(org.eclipse.jface.dialogs.Dialog) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice) Menu(org.eclipse.swt.widgets.Menu) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) CurrencyColumn(name.abuchen.portfolio.ui.views.columns.CurrencyColumn) TaxonomyColumn(name.abuchen.portfolio.ui.views.columns.TaxonomyColumn) AttributeColumn(name.abuchen.portfolio.ui.views.columns.AttributeColumn) NoteColumn(name.abuchen.portfolio.ui.views.columns.NoteColumn) IsinColumn(name.abuchen.portfolio.ui.views.columns.IsinColumn) Column(name.abuchen.portfolio.ui.util.viewers.Column) LatestSecurityPrice(name.abuchen.portfolio.model.LatestSecurityPrice) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice) Security(name.abuchen.portfolio.model.Security)

Example 44 with SecurityPrice

use of name.abuchen.portfolio.model.SecurityPrice in project portfolio by buchen.

the class CSVSecurityPriceExtractor method extract.

private SecurityPrice extract(String[] rawValues, Map<String, Column> field2column) throws ParseException {
    LocalDateTime date = getDate(Messages.CSVColumn_Date, rawValues, field2column);
    if (date == null)
        throw new ParseException(MessageFormat.format(Messages.CSVImportMissingField, Messages.CSVColumn_Date), 0);
    Long amount = getQuote(Messages.CSVColumn_Quote, rawValues, field2column);
    if (amount == null)
        throw new ParseException(MessageFormat.format(Messages.CSVImportMissingField, Messages.CSVColumn_Quote), 0);
    return new SecurityPrice(date.toLocalDate(), Math.abs(amount));
}
Also used : LocalDateTime(java.time.LocalDateTime) ParseException(java.text.ParseException) SecurityPrice(name.abuchen.portfolio.model.SecurityPrice)

Example 45 with SecurityPrice

use of name.abuchen.portfolio.model.SecurityPrice in project portfolio by buchen.

the class SecurityIndex method calculate.

/* package */
void calculate(PerformanceIndex clientIndex, Security security) {
    List<SecurityPrice> prices = security.getPrices();
    if (prices.isEmpty()) {
        initEmpty(clientIndex);
        return;
    }
    // prices only include historical quotes, not the latest quote. Merge
    // the latest quote into the list if necessary
    prices = security.getPricesIncludingLatest();
    Interval actualInterval = clientIndex.getActualInterval();
    LocalDate firstPricePoint = prices.get(0).getDate();
    if (firstPricePoint.isAfter(actualInterval.getEnd())) {
        initEmpty(clientIndex);
        return;
    }
    LocalDate startDate = clientIndex.getFirstDataPoint().orElse(actualInterval.getEnd());
    if (firstPricePoint.isAfter(startDate))
        startDate = firstPricePoint;
    LocalDate endDate = actualInterval.getEnd();
    LocalDate lastPricePoint = prices.get(prices.size() - 1).getDate();
    if (lastPricePoint.isBefore(endDate))
        endDate = lastPricePoint;
    int size = (int) ChronoUnit.DAYS.between(startDate, endDate) + 1;
    if (size <= 0) {
        initEmpty(clientIndex);
        return;
    }
    // needs currency conversion if
    // a) the currency of the security is not null
    // (otherwise it is an index)
    // b) the term currency differs from the currency of the security
    CurrencyConverter converter = security.getCurrencyCode() != null && !security.getCurrencyCode().equals(clientIndex.getCurrencyConverter().getTermCurrency()) ? clientIndex.getCurrencyConverter() : null;
    dates = new LocalDate[size];
    delta = new double[size];
    accumulated = new double[size];
    inboundTransferals = new long[size];
    outboundTransferals = new long[size];
    totals = new long[size];
    final double adjustment = clientIndex.getAccumulatedPercentage()[Dates.daysBetween(actualInterval.getStart(), startDate)];
    // first value = reference value
    dates[0] = startDate;
    delta[0] = 0;
    accumulated[0] = adjustment;
    long valuation = totals[0] = convert(converter, security, startDate);
    // calculate series
    int index = 1;
    LocalDate date = startDate.plusDays(1);
    while (date.compareTo(endDate) <= 0) {
        dates[index] = date;
        long thisValuation = totals[index] = convert(converter, security, date);
        long thisDelta = thisValuation - valuation;
        delta[index] = (double) thisDelta / (double) valuation;
        accumulated[index] = ((accumulated[index - 1] + 1 - adjustment) * (delta[index] + 1)) - 1 + adjustment;
        date = date.plusDays(1);
        valuation = thisValuation;
        index++;
    }
}
Also used : SecurityPrice(name.abuchen.portfolio.model.SecurityPrice) LocalDate(java.time.LocalDate) Interval(name.abuchen.portfolio.util.Interval) CurrencyConverter(name.abuchen.portfolio.money.CurrencyConverter)

Aggregations

SecurityPrice (name.abuchen.portfolio.model.SecurityPrice)52 Security (name.abuchen.portfolio.model.Security)34 LocalDate (java.time.LocalDate)24 PortfolioTransaction (name.abuchen.portfolio.model.PortfolioTransaction)22 ArrayList (java.util.ArrayList)21 Test (org.junit.Test)20 TestCurrencyConverter (name.abuchen.portfolio.TestCurrencyConverter)15 LatestSecurityPrice (name.abuchen.portfolio.model.LatestSecurityPrice)11 Client (name.abuchen.portfolio.model.Client)10 List (java.util.List)7 Values (name.abuchen.portfolio.money.Values)6 OpenDialogAction (name.abuchen.portfolio.ui.dialogs.transactions.OpenDialogAction)6 MessageFormat (java.text.MessageFormat)5 BiFunction (java.util.function.BiFunction)5 Function (java.util.function.Function)5 Collectors (java.util.stream.Collectors)5 AccountTransaction (name.abuchen.portfolio.model.AccountTransaction)5 Taxonomy (name.abuchen.portfolio.model.Taxonomy)5 Watchlist (name.abuchen.portfolio.model.Watchlist)5 Factory (name.abuchen.portfolio.online.Factory)5