|
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 |
[Zorro145]
|
Post subject: Timing Stop Loss |
Post rating: 0
|
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?
|
|
|
|
 |
[quantisan]
|
Post subject: Re: Timing Stop Loss |
Post rating: 0
|
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()
|
|
|
|
 |
[Zorro145]
|
Post subject: Re: Timing Stop Loss |
Post rating: 0
|
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
|
|
|
|
 |
Cashbone
|
Post subject: Re: Timing Stop Loss |
Post rating: 0
|
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.
|
|
|
|
 |
API Support
|
Post subject: Re: Timing Stop Loss |
Post rating: 0
|
Posted: Wed 03 Nov, 2010, 13:43
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|