use of name.abuchen.portfolio.snapshot.SecurityPosition in project portfolio by buchen.
the class SecurityPerformanceSnapshot method addPseudoValuationTansactions.
private static void addPseudoValuationTansactions(Portfolio portfolio, CurrencyConverter converter, ReportingPeriod period, Map<Security, SecurityPerformanceRecord> records) {
PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, converter, period.getStartDate());
for (SecurityPosition position : snapshot.getPositions()) {
records.get(position.getSecurity()).addTransaction(new DividendInitialTransaction(position, period.getStartDate().atStartOfDay()));
}
snapshot = PortfolioSnapshot.create(portfolio, converter, period.getEndDate());
for (SecurityPosition position : snapshot.getPositions()) {
records.get(position.getSecurity()).addTransaction(new DividendFinalTransaction(position, period.getEndDate().atStartOfDay()));
}
}
Aggregations