- Trading Principles - Trade - MetaTrader 5 for Android
- Trading Principles - Trade - MetaTrader 5 for iPhone
- Bulk Operations - Trade - MetaTrader 5 for Android
What is your problem ?
Sorry, I changed example of problem.
Sorry, I changed example of problem.
Just count down :
for (int pos = OrdersTotal()-1; pos>=0 ; pos--)
Just count down :
// [#1] [#2] [#4]
// pos = OrdersTotal() - 1 (2), OrderSelect() select [#4]
// remove [#1] [#2], add [#5] => [#4] [#5]
// Next loop, pos = 1 then OrderSelect() again select [#4]
The problem is that orders was changed while EA process.
Can I lock trade process?
you can
then position shift don't matter.
make sure to check OrderCloseTime() to see if it's a opened or closed order.
But, EA don't know ticket Before SELECT_BY_POS loop.
they do if you do
ticket=OrderSend(...
i am not sure what you are trying to do.
probably you only need to improve your code.
But, EA don't know ticket Before SELECT_BY_POS loop.
You are searching problem where there is not.
If you have a problem, ask a specific question and provide actual code.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use