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.

Delay in sec after order is closed
 Post subject: Delay in sec after order is closed Post rating: 0   New post Posted: Sun 10 Aug, 2014, 22:05 
User avatar

User rating: 0
Joined: Mon 16 Jun, 2014, 06:30
Posts: 18
Location: Latvia,
Hello!
I have exception for entering market again after order is closed:

if((System.currentTimeMillis()/1000L-lastOrderTimeClose)<60) return;


It is working correct except running my strategy in history tester.
Please help me convert my code to JForex time, not system time.

Thank you


 
 Post subject: Re: Delay in sec after order is closed Post rating: 0   New post Posted: Mon 11 Aug, 2014, 08:15 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
use IHistory.getLastTick(myInstrument).getTime().


 
 Post subject: Re: Delay in sec after order is closed Post rating: 0   New post Posted: Mon 11 Aug, 2014, 08:22 
User avatar

User rating: 0
Joined: Mon 16 Jun, 2014, 06:30
Posts: 18
Location: Latvia,
Thank you


 
 Post subject: Re: Delay in sec after order is closed Post rating: 0   New post Posted: Mon 11 Aug, 2014, 08:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can also use IOrder.getCloseTime().


 

Jump to:  

cron
  © 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