Dear, I am testing an EA in the tester and the log shows error 138. I mean, the tester generates requotes? I suspect I have an error somewhere in this part of the code
If you really have an error, please advise me what is wrong?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Dear, I am testing an EA in the tester and the log shows error 138. I mean, the tester generates requotes? I suspect I have an error somewhere in this part of the code
If you really have an error, please advise me what is wrong?Probably the wrong price in OrderClose()
Probably incorrect price in OrderClose()
How do you check/correct?
Use the price valid at the time the request was sent to the server.
Use the valid price at the time the request is sent to the server.
How can I check/correct ?
Actually, there is a branch of psychics waiting for this question. It's not clear from your code what kind of order you are closing.
Is it OP_BUY ?
OrderSymbol() is the same as Symbol() ?
Don't I get a valid price with RefreshRates?
You do if RefreshRates() returns true.
The only question is: "is the Bid the price at which the order can be closed?"
Actually, the psychic branch is waiting for this question. It is not clear from your code what order you are closing.
Is it OP_BUY ?
OrderSymbol() is the same as Symbol() ?
OrderSymbol() is equal to Symbol()
I close all open orders both longs and shorts.
You do if RefreshRates() returns true.
The only question is: "is Bid the price at which the order can be closed?"
I.e. to separate the closing of longs and shorts?
OrderSymbol() is the same as Symbol()
I close all open orders, both longs and shorts.
What are the other shorts at Bid price ?
Only orders of OP_BUY type can be closed by Bid
what other shorts at Bid price ?
Only orders of type OP_BUY can be closed at Bid
OrderSymbol() is the same as Symbol()
I close all open orders both longs and shorts.
I.e. separate the closing of longs and shorts?