Download MetaTrader 5
To add comments, please log in or register
Read the interviews of the Automated Trading Championship participants
ed1210
99
ed1210 2014.09.17 14:19 
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
whroeder1
13627
whroeder1 2014.09.17 17:03  
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
/
To add comments, please log in or register