Hello I have a problem with requotes and need your advice.
When I send an open or close order to a broker, he sends me requotes so many times that it throws a TOO_MANY_ORDERS error. How do you guys handle that error? I mean, I have created a function that resends the request to him again and again until he executes it or throws that error, but my question is, how many times is it reasonable to resend the order and stop after it? 10, 20, ..., 100 times? Please see the count variable.
Requotes error ? you mean error 138
This is what you should do:
"The requested price has become out of date or bid and ask prices have been mixed up. The data can be refreshed without any delay using the RefreshRates function and make a retry. If the error does not disappear, all attempts to trade must be stopped, the program logic must be changed."
from here: Trading errors
. . . so make one retry if that doesn't work fix your code.
Hi, thanks for your answer. Not 138, it is error 141 = ERR_TOO_MANY_REQUESTS.
If the requested price has become out of date, Im handling that in my while cycle...I RefreshRates() and resend again
Ah now I got it. So Im not completely sure it is related to requotes, but the problem is such, when I request to close 20 orders there are situations when it closes only 18 and leaves 2 open. I blamed it on requote but you made it clear and now I understand that requote is not guilty. So why does it happen?
Thank you very much you've been very helpful.
the selected order can be having other Symbol() also
Closing at Bid won't help in that case...
status = OrderClose(OrderTicket(), OrderLots(), Bid, 3);
the selected order can be having other Symbol() also
Closing at Bid won't help in that case...
No, the symbol is filtered out in the for cycle. I didn't include in order to concentrate only on the actual problem. Thanks
Thank you Ill take this into consideration. Is there any other thing I should adjust for 4/5 digit brokers? I mean, if lots, open price (bid or ask) or stops need to be adjusted for that...
No, the symbol is filtered out in the for cycle. I didn't include in order to concentrate only on the actual problem.
Don't agree. If you so sure it is filtered out in the for cycle then show me how .......
Let me learn from you...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello I have a problem with requotes and need your advice.
When I send an open or close order to a broker, he sends me requotes so many times that it throws a TOO_MANY_ORDERS error. How do you guys handle that error? I mean, I have created a function that resends the request to him again and again until he executes it or throws that error, but my question is, how many times is it reasonable to resend the order and stop after it? 10, 20, ..., 100 times? Please see the count variable. Also related to this question: why does broker leave my orders open sometimes? e.i. when I send an order to close 20 orders he might close 18 and leave 2 open. How can I handle this as well? Thank you