Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

setting: time or ticks left for bar to complete
 Post subject: setting: time or ticks left for bar to complete Post rating: 0   New post Posted: Tue 16 Jul, 2013, 07:31 

User rating: 0
Joined: Wed 26 Jun, 2013, 18:18
Posts: 5
Dear All,

I just wonder if, like in other platforms, there is a way to display in the chart how long is left for the candle to complete. e.g., if it is a 5 min graph, and there have passed 4 minutes since the beginning, then on the right (or somewhere else) it would be useful to see a '1 min' or '60 secs'.

The same would apply to tick charts.

In the preferences window I do not see the option to do it.

Thanks in advance.

Best Regards and Happy Pips.

PapaGonzalo


 
 Post subject: Re: setting: time or ticks left for bar to complete Post rating: 1   New post Posted: Tue 16 Jul, 2013, 12:08 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
I don't think so there is a built-in platform support for this.

However with some coding you can create a strategy that does the same (put a countdown on the chart).
If you need help with that, I suggest to create a separate topic in the Automated Trading->KnowledgeBase section (as this has nothing to do with Trading Platforms' Bug Reports), and start coding :).

Some help as start:
You will need
a scheduler: https://www.dukascopy.com/wiki/#Threadin ... _execution
some chart object: https://www.dukascopy.com/wiki/#Create_a ... rt_objects
and some calculation:
...
IBar currentBar = history.getBar(chart.getInstrument(), chart.getSelectedPeriod(), OfferSide.BID, 0);
SimpleDateFormat countDownTime = new SimpleDateFormat("HH:mm:ss");
countDownTime.setTimeZone(TimeZone.getTimeZone("GMT"));
String timeLeft = countDownTime.format(currentBar.getTime() + chart.getSelectedPeriod().getInterval() - new Date().getTime()); // put this on the chart
...


 
 Post subject: Re: setting: time or ticks left for bar to complete Post rating: 0   New post Posted: Tue 16 Jul, 2013, 21:40 

User rating: 0
Joined: Wed 26 Jun, 2013, 18:18
Posts: 5
Hi,

Thanks a lot. That was helpful. I'll have a look.

Best Regards,

PapaGonzalo


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com