does
getLastTick(Instrument instrument)
return the last tick that was triggered in onTick on the client's side,
or the real last tick that was processed by the DK-server?
If getLastTick contains the last processed tick on the server, the following code would retrieve the missing ticks:
...
private IHistory history = null;
...
private long glLastTickTimeProcessed = 0;
...
public void onStart(IContext context) throws JFException
{
...
this.history = context.getHistory();
...
}
...
public void onTick(Instrument _instrument, ITick _tick) throws JFException
{
if (glLastTickTimeProcessed != 0 && glLastTickTimeProcessed != history.getLastTick(_instrument))
{
List<ITick> alMissedTick = history.getTicks(_instrument, glLastTickTimeProcessed + 1, _tick.getTime() - 1);
//... add code to process missed ticks here...
}
glLastTickTimeProcessed = _tick.getTime();
//... further processing of current tick...
}
Alternatively DukasCopy could maybe make this available through a new function (if this could provide a faster way to collect and access the missed ticks):
List>ITick> IHistory.getLastTicksMissed(Instrument instrument)
and ...
Long IHistory.getLastTicksMissedCount(Instrument instrument)
as a fast way to get the number of missed ticks without having to load them and maybe take action depending on the number of missed tick...
Best, RR.