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