![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Afternoon.
EA puts limit bylimit orders following price movement at distance =Distance.
I need to delete excessive (farthest) orders as the price moves upwards.
I have done it. But for some reason, it works very incorrectly! The first order is deleted normally. Then, on the contrary, the ones closest to the price are deleted! Then they stop or are deleted "out of the blue", and the log generates error 4108 (unknown ticket). Then for some time they are deleted normally.
I believe it was said somewhere around here that it is important to properly reorder.
However. Regardless of whether we organize the oversight from the "end" or from the beginning. The result is incorrect.
The code seems to be the simplest one!
What may be wrong here? Please advise!
(OrderSelect(z,SELECT_BY_TICKET, MODE_TRADES)
SELECT_BY_POS
(OrderSelect(z,SELECT_BY_TICKET, MODE_TRADES))
SELECT_BY_POS
Go through the index instead of the ticket ? I'm going to try it now...
...to cycle through the index instead of the ticket? I'll try that...
you have an index loop... what does this have to do with the ticks. and bring back the line with the reverse loop...
Thank you, JavaDev ! I did as I was told. And it's working!
I can't even believe it. I've been struggling for three days now....
Thank you, JavaDev ! I did as I was told. And it's working!
I can't even believe it. Three days of trouble already....
welcome