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