Download MetaTrader 5

HELPPPPP!!!!!! trying to close pending orders - page 2

To add comments, please log in or register
Vasyl Nosal
19167
Vasyl Nosal  
GumRai:

How can it be ok?

The loop only checks the first order, so there may be a buy order, but if it is not in the highest position, it will not be detected.

If last was not buy than he needs to delete pending. If it is buy than he do not want to delete pending.

What is the problem? 

whroeder1
15904
whroeder1  
eevviill: If last was not buy than he needs to delete pending. What is the problem? 
  1. Wrong. If the last was not a buy then it is a pending. No deletions unless there is a buy somewhere.
  2. If the last is a pending, and the code does not delete anything. Go look at the code again.
jtubbs13791
71
jtubbs13791  
removing else worked. Thank you. didnt know else only look at previous trade only
whroeder1
15904
whroeder1  
Removing the else was not the answer, moving the return false outside the loop is.
12
To add comments, please log in or register