|
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.
waitForUpdate on setStopLoss |
[Oliver]
|
Post subject: waitForUpdate on setStopLoss |
Post rating: 0
|
Posted: Fri 15 Oct, 2010, 14:02
|
|
User rating: 0
Joined: Mon 04 Jan, 2010, 19:56 Posts: 9
|
I have the following problem: When I want to merge orders, I need to delete the StopLoss of the corresponding orders. Thus my merging process consists of:
order1.setStopLossPrice(0); order2.setStopLossPrice(0);
**wait until done**
engine.mergeOrders(newLabel, order1, order2);
Until now the **wait until done** part was done by a Thread.sleep. However, this causes problems in times with high volatility (Thread overload). I thought of using waitForUpdate() method, but does this react on changes of the StopLoss? And besides: Does this solve the general problem, since I expect the change of StopLosses to take a while on live accounts at times with strong volatility?
Thanks.
|
|
|
|
 |
API Support
|
Post subject: Re: waitForUpdate on setStopLoss |
Post rating: 0
|
Posted: Mon 18 Oct, 2010, 09:50
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Hi,
waitForUpdate method reacts on changes of the stop loss You need to use waitForUpdate() method for your order, but it is necessary to check if the order stop loss is equal to 0 and order is in filled status before merge.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|