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.

want to support by someone.
 Post subject: want to support by someone. Post rating: 0   Post Posted: Sun 19 May, 2013, 16:21 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
in java file,I get new Date() ,in order to get today' time

depend on this ,submit the forex orders

in local running ,it's ok.but when testing the strategy on history datas,there is a bug..it can not work。what shall I do ??
thank you.


 
The Best Answer  Post subject: Re: want to support by someone. Post rating: 2   Post Posted: Sun 19 May, 2013, 21:22 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi zzping115:

You can get the time on real time or on historical tester getting for example the time of last tick or bar.

Something like:
long time = history.getLasTick().getTime();

// or (but you need to take in consideration the elapsed time depending on period selected)

long barTime = history.getPreviousBarStart(Period.TEN_SECS, tick.getTime());

// or on onTick() method

long time = tick.getTime();

// or on onBar() method (but you need to take in consideration the elapsed time depending on period selected)

long barTime = bar.getTime();


I hope this can help.

Trade well

JL


 
 Post subject: Re: want to support by someone. Post rating: 0   Post Posted: Sat 01 Jun, 2013, 10:11 
User avatar

User rating: 0
Joined: Wed 28 Mar, 2012, 06:41
Posts: 25
Location: China, Beijing
jlongo wrote:
Hi zzping115:

You can get the time on real time or on historical tester getting for example the time of last tick or bar.

Something like:
long time = history.getLasTick().getTime();

// or (but you need to take in consideration the elapsed time depending on period selected)

long barTime = history.getPreviousBarStart(Period.TEN_SECS, tick.getTime());

// or on onTick() method

long time = tick.getTime();

// or on onBar() method (but you need to take in consideration the elapsed time depending on period selected)

long barTime = bar.getTime();


I hope this can help.

Trade well

JL



thank you very much.


 

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