It would be much easier to implement it from a strategy - consider updating an
ITextChartObject on every new tick - i.e. in the
IStrategy.onTick method.
The unfinished bar start time and the remaining time you will get the following way:
long barStart = history.getBarStart(chart.getFeedDescriptor().getPeriod(), tick.getTime());
long remainingSecs = TimeUnit.MILLISECONDS.toSeconds(tick.getTime() - barStart);
for more on bar history methods see:
https://www.dukascopy.com/wiki/#History_barsPlace on chart and manage chart objects in the following way:
https://www.dukascopy.com/wiki/#Create_and_manage_chart_objectsIn particular, see here the example for the text object usage:
https://www.dukascopy.com/wiki/#Chart_object_catalog