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);