OrderSelect issue

 
What's wrong with this?, total = CountTrades(); if (total == 0) flag = TRUE; for (cnt = OrdersTotal() - 1; cnt >= 0; cnt--) { OrderSelect(0, SELECT_BY_POS); if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue; if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) { if (OrderType() == OP_BUY) { LongTrade = TRUE; ShortTrade = FALSE; break; I get the message "return value of 'OrderSelect' should be checked". Thanks, Ed
 
Ed1210: What's wrong with this?,total = CountTrades();if (total == 0) flag = TRUE;for (cnt = OrdersTotal() - 1; cnt >= 0; cnt--) {OrderSelect(0, SELECT_BY_POS);if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) {if (OrderType() == OP_BUY) {LongTrade = TRUE;ShortTrade = FALSE;break;I get the message "return value of 'OrderSelect' should be checked".Thanks, Ed
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. 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