[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 533 1...526527528529530531532533534535536537 New comment PapaYozh 2011.07.20 10:13 #5321 Sancho77: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() [Deleted] 2011.07.20 10:16 #5322 PapaYozh: Probably incorrect price in OrderClose() How can I check/correct? PapaYozh 2011.07.20 10:19 #5323 Sancho77: How do you check/correct? Use the price valid at the time the request was sent to the server. [Deleted] 2011.07.20 10:26 #5324 PapaYozh: Use the valid price at the time the request is sent to the server. Don't I use RefreshRates to get a valid price? PapaYozh 2011.07.20 10:26 #5325 Sancho77: 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() ? [ARCHIVE!] Any rookie question, Any questions from newcomers Questions about elite and PapaYozh 2011.07.20 10:29 #5326 Sancho77: 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?" [Deleted] 2011.07.20 10:30 #5327 PapaYozh: 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. PapaYozh: 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? PapaYozh 2011.07.20 10:32 #5328 Sancho77: 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 [Deleted] 2011.07.20 10:34 #5329 PapaYozh: what other shorts at Bid price ? Only orders of type OP_BUY can be closed at Bid Thanks for the help! PapaYozh 2011.07.20 10:36 #5330 Sancho77: OrderSymbol() is the same as Symbol() I close all open orders both longs and shorts. I.e. separate the closing of longs and shorts? if ( OrderType()=OP_BUY ) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Orange); else if ( OrderType()=OP_SELL ) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Orange); 1...526527528529530531532533534535536537 New comment
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?