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.

Timing Stop Loss
 Post subject: Timing Stop Loss Post rating: 0   New post Posted: Tue 26 Oct, 2010, 18:38 

User rating: 0
Joined: Tue 26 Oct, 2010, 18:32
Posts: 4
Dear Support,

I am not able to set a timing Stop Loss. For instance, close a position after 10 minutes its opening if it has not achieved the TP. I have tried to utilize the tick.getTime() without results. Could you have some samples?


 
 Post subject: Re: Timing Stop Loss Post rating: 0   New post Posted: Thu 28 Oct, 2010, 17:21 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
maybe comparing current system time with IOrder.getFillTime()


 
 Post subject: Re: Timing Stop Loss Post rating: 0   New post Posted: Thu 28 Oct, 2010, 17:55 

User rating: 0
Joined: Tue 26 Oct, 2010, 18:32
Posts: 4
Thanks Quantisan,

but how is the data type "long" that comes from IOrder.getFillTime()? Is it an integer that has started from a specific date and grows up until now? And which is the unit? One second? One millisecond? Or it is in the format hh:mm:ss?
I do not know how manage it...

Sorry, I do not know whether my question is clear...

Thanks in advance


 
 Post subject: Re: Timing Stop Loss Post rating: 0   New post Posted: Fri 29 Oct, 2010, 18:32 

User rating: 3
Joined: Tue 17 May, 2011, 16:51
Posts: 38
Location: Sweden, Jonkoping
I recently researched this myself. Time is in milliseconds. So if you want to add 10 minutes you can convert that to milliseconds (10m * 60s * 1000ms) and just add that number to the time the order was opened.


 
 Post subject: Re: Timing Stop Loss Post rating: 0   New post Posted: Wed 03 Nov, 2010, 13:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please take a look at the following JForex Wiki page https://www.dukascopy.com/wiki/index.php/Use_timer


 

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