Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 703
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
YES. This is exactly what Sergei Kovalev's textbook is all about. It is the one that is missing a lot at the moment.
There is no textbook on mql5 as such on this site, I don't know about others. But there are a lot of articles, read them, you may succeed.
Gentlemen programmers!
Please help me solve a problem I've been struggling with for a month.
My TS sometimes doesn't close orders for some reason.
It looks like this:
The first three orders - 44329646, 44330563 and 44337351 open and close perfectly.
And on the fourth order, the tragedy happens:
and so on to infinity...
That is, an Expert Advisor opens order 44339156 and tries to close order 44337351 that it itself (!!!!) successfully closed several hours earlier.
You have to close it manually; if you fail to do that, you will sometimes suffer from the deepest drawdown. What a disaster!
How is it possible?
The code of the Expert Advisor is as simple as can be:
How can one and the same program work "time after time"? I don't understand...
Gentlemen programmers!
Please help me solve a problem I've been struggling with for a month.
My TS sometimes doesn't close orders for some reason.
It looks like this:
The first three orders - 44329646, 44330563 and 44337351 open and close fine.
And on the fourth order, the tragedy happens:
and so on to infinity...
That is, an Expert Advisor opens order 44339156 and tries to close order 44337351 that it itself (!!!!) successfully closed several hours earlier.
You have to close it manually; if you fail to do that, you will sometimes suffer from the deepest drawdown. What a disaster!
How is it possible?
The code of the Expert Advisor is as simple as can be:
How can one and the same program work "time after time"? I do not understand...
Read the Help for OrderSelect(). In particular, read the reference on selection by ticket. Even a closed order is selected by ticket. It is already closed, and you are trying to close it again.
If 0, it means that it is still in the market, close it, if > 0, it means that it is already closed and there is no need to kick it again, it will not come to life and will not close.
Read the help for OrderSelect(). Particularly about selection by ticket. Even a closed order is selected by the ticket. It is already closed, and you are trying to close it again.
If it is selected, check the closing time - if 0, it means it is still in the market - close it, if > 0, it means it has already been closed and you do not have to kick it again - it will not come to life and will not close.
Thank you very much - I will try.
Thank you very much - I will give it a try.
You're welcome. You don't have to try it, you have to do it...
Please. You don't have to try it, you have to do it...
Artem, I have read the help - everything seems to be correct.
I am checking the closing time.
I have read it in MQL4 Reference:
It is recommended to call the OrderSelect() function immediately before calling for the latest order data.
This is also true.
Then what is wrong?
Artem, I have read the help - everything seems to be correct.
I am checking the closing time.
I have read it in MQL4 Reference:
It is recommended to call the OrderSelect() function immediately before calling for the latest order data.
This is also true.
Then what's wrong?
What kind of function is this?
total_orders_NZDUSD=TotalOrders("NZDUSD.I");
And after it has been worked, which order is allocated?Gentlemen programmers!
Please help me solve a problem I've been struggling with for a month.
My TS sometimes doesn't close orders for some reason.
It looks like this:
The first three orders - 44329646, 44330563 and 44337351 open and close fine.
And on the fourth order, the tragedy happens:
and so on to infinity...
That is, an Expert Advisor opens order 44339156 and tries to close order 44337351 that it itself (!!!!) successfully closed several hours earlier.
You have to close it manually; if you fail to do that, you will sometimes suffer from the deepest drawdown. What a disaster!
How is it possible?
The code of the Expert Advisor is as simple as can be:
How can one and the same program work "time after time"? I don't understand...
what direction are you looking at the order array ?
If there are possible closures/deletions during "revision", it's better to look in the opposite direction. From OrdersTotal()-1 to 0 inclusive.
Otherwise, you may step on it :-)
What is this feature?
This function was kindly given to me by Goldtrader, for which I am sincerely grateful.
It allows you to open orders simultaneously for different currency pairs.
:))) In my opinion, it is what started it all, because I enabled it about a month ago... Without it I cannot see the Grail.
Something wrong with it?
There's something really wrong, though...
I mean, I doOrderSelect once and then again from the function... It doesn't make sense...