@Override
public void run() {
Random random = new Random();
double lastClose = AVERAGE_PRICE;
while (activated) {
IOHLCPoint point = generateRandomPoint(random, lastClose, VOL_PRICE, AVERAGE_VOLUME, VOL_VOLUME, new Date());
lastClose = point.getClose();
if (notifyBarListener) {
try {
barListener.onRealTimeBar(point);
} catch (Throwable t) {
// burp!
}
}
if (notifyTickListener) {
ITickPoint tick = new TickPoint(point.getIndex(), DATA_TYPES[0], point.getClose(), point.getVolume().intValue());
try {
tickListener.onTick(tick);;
} catch (Throwable t) {
// burp!
}