day.set(Calendar.SECOND, 0);
day.set(Calendar.MILLISECOND, 0);
day.set(Calendar.YEAR, 2009);
day.set(Calendar.MONTH, 0);
day.set(Calendar.DAY_OF_MONTH, i);
StockData data = new StockData();
data.setOpen(begin);
double close = Math.round(begin + Math.random() * begin * 0.1);
data.setClose(close);
data.setLow(Math.round(Math.min(begin, begin - Math.random() * begin * 0.1)));
data.setHigh(Math.round(Math.max(begin, close) + Math.random() * 2));
data.setVolume(1000 + (int) (Math.random() * 500));
begin = close;
data.setDate(day.getTime());
history.add(data);
}
return history;
}