You should call sleep while the
history.getLastTick(instrument)=null, e.g.:
//wait max 10 secs
while(history.getLastTick(instrument) == null && i < 10){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
console.getOut().println("Last tick for " + instrument + " at " + DateUtils.format(System.currentTimeMillis())+ " is null");
i++;
}
Or alternatively you can do you processing as soon as you receive the first tick in the
onTick of the respective instrument - this will not hold up your other strategy executions.