|
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.
enter and close at the same time |
[shzhning]
|
Post subject: enter and close at the same time |
Post rating: 0
|
Posted: Tue 17 May, 2011, 03:58
|
|
User rating: 0
Joined: Tue 17 May, 2011, 03:57 Posts: 1
|
Hello, my strategy's entry signal is also my exit signal. In other word, when the signal is triggered, I'm opening new position and close existing position (if any) at the same time. How do I program java to achieve this?
Thank you!
|
|
|
|
 |
API Support
|
Post subject: Re: enter and close at the same time |
Post rating: 0
|
Posted: Tue 17 May, 2011, 15:53
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
Guest
|
Post subject: Re: enter and close at the same time |
Post rating: 0
|
Posted: Wed 18 May, 2011, 14:49
|
|
User rating: -
|
Thanks for the quick reply.
I do know how to place bid and close order. What I was trying to clarify is how do I place them at the same time and have JForex execute these orders without losing one of them. When I tested my strategy, for some reason, only one was filled and the other was ignored. And I cannot figure out why.
|
|
|
|
 |
API Support
|
Post subject: Re: enter and close at the same time |
Post rating: 0
|
Posted: Thu 19 May, 2011, 09:54
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Could you please post the part of your code that closes the order and opens a new one? Do you check the results of your requests? You need to correctly handle situations when one of the close or open requests is rejected. In this situation you can repeat the request or maybe if it happens too often increase the slippage.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|