What does this mean?

 
int total;
    total  = OrdersTotal(); 

    for(cnt = 0; cnt < total; cnt++)
      {
        OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
        if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) // Isn't it a less than, equal to sign?
          {
            if(OrderType() == OP_BUY)   // Why checking BUY while checking a SELL?
              {
                        OrderClose(OrderTicket(),Lots,Bid,3,Green);
                        return(0);
                      }
    
 

It's quite common in MQL4 code. OP_BUY is zero; OP_SELL is 1; all pending orders such as OP_BUYLIMIT have IDs from 2 upwards. Therefore, OrderType() <= OP_SELL is a way of saying "if the selected ticket is an open position rather than a pending order..."

It's simpler, though less clear, than  (OrderType() == OP_BUY || OrderType() == OP_SELL) 

 
qgmql:
( BTW, the code you are quoting is very bad. See the countless posts on this forum about looping from OrdersTotal()-1 downwards, rather than from zero upwards, when closing orders. )
 
jjc: It's simpler, though less clear, than  (OrderType() == OP_BUY || OrderType() == OP_SELL)
Write self-documenting code and it's very clear.
bool OrderIsPending(void){ return OrderType() >= OP_BUYLIMIT; }
bool OrderIsOpen(void){    return !OrderIsPending();          }
qgmql: less than, equal to sign? Why checking BUY while checking a SELL?
  1. Less/equal - open order vs pending like jjc
  2. You have to check the order type if you want to specify the proper closing price (Bid/Ask.) Instead just use OCP
  3. You must count down when closing/deleting in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum
    for(int pos = OrdersTotal() - 1; pos > 0; --pos) if(
       OrderSelect(pos, SELECT_BY_POS)
    && OrderIsOpen()
    && OrderSymbol() == Symbol()
    ){
       tbd OrderClose(OrderTicket(),Lots,OrderClosePrice(),3,Green);
    }
  4. Check your return codes (OrderSelect and OrderClose) What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
 
WHRoeder:

Surely...  

bool OrderIsPending(void){ return OrderType() >= OP_BUYLIMIT; }
bool OrderIsOpen(void){    return !OrderIsPending();             }
 
WHRoeder:
jjc: It's simpler, though less clear, than  (OrderType() == OP_BUY || OrderType() == OP_SELL)
Write self-documenting code and it's very clear.
qgmql: less than, equal to sign? Why checking BUY while checking a SELL?
  1. Less/equal - open order vs pending like jjc
  2. You have to check the order type if you want to specify the proper closing price (Bid/Ask.) Instead just use OCP
  3. You must count down when closing/deleting in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum
  4. Check your return codes (OrderSelect and OrderClose) What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
"attached file" was given to me to check. if you please highlight the things, for which i must find topics in book. or this EA is having a bad code in all? (BTW its giving positive results to a trader, except one thing that it opens an other trade right after a trade is closed)
Files:
 
  1.     total  = OrdersTotal(); 
        if(total < 1) 
    Means the EA is incompatible with every other, including itself on other charts and manual trading. order accounting - MQL4 forum
  2. for(cnt = 0; cnt < total; cnt++)
    You must count down when closing/deleting in a position loop. Get in the habit of always counting down. Loops and Closing or Deleting Orders - MQL4 forum