Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

time remaining to the close of a candle indicator needed
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=77&t=50112
Page 1 of 1

Author:  gregska [ Sun 29 Sep, 2013, 17:57 ]
Post subject:  time remaining to the close of a candle indicator needed

Hi guys,

I need an indicator that shows time left to the close of a candle for jforex.
Anybody can help with that???

thanx,
Greg

ps. you can pm me also on [email protected]

Author:  tcsabina [ Tue 01 Oct, 2013, 11:39 ]
Post subject:  Re: time remaining to the close of a candle indicator needed

Hi,

You rather create a strategy with such functionality, as drawing on the chart (to show the countdown) is easier from strategy.
You can use the following pseudo code to update a chart object's text with the countdown text:
currentBar = history.getBar(chart.getInstrument(), chart.getSelectedPeriod(), OfferSide.BID, 0);
obj.setText(countDownTime.format(currentBar.getTime() + chart.getSelectedPeriod().getInterval() - new Date().getTime()));

  Page 1 of 1