Check the return value of orderselect look in the reference for the description;
result 3 error(s) description & stilll warning return value of 'OrderSelect' should be checked, as bellow
'var' - undeclared identifier line 6
'select' - undeclared identifier line 6
'select' - some operator expected line 6
return value of 'OrderSelect' should be checked coba2.mq4 line 6
how to declare it ?
result 3 error(s) description & stilll warning return value of 'OrderSelect' should be checked, as bellow
'var' - undeclared identifier line 6
'select' - undeclared identifier line 6
'select' - some operator expected line 6
return value of 'OrderSelect' should be checked coba2.mq4 line 6
how to declare it ?
try this....
1 int BreakEven(int MN){ 2 int Ticket=0; 3 4 5 for(int i = OrdersTotal() - 1; i >= 0; i--) { 6 if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES))break; 7 if(OrderSymbol() != Symbol() && OrderMagicNumber() != MN){continue;} 8 if(OrderSymbol() == Symbol() && OrderMagicNumber() == MN){ 9 Ticket = OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Green); 10 if(Ticket < 0) Print("Error in Break Even : ", GetLastError()); 11 break; 12 } 13 } 14 15 return (Ticket); 16 }
try this....
ok thanks a lot its running without error/warning desc.....
you are welcome ;)
- Kenneth Parling #: try this....
Try simplifying your code
for(int i = OrdersTotal() - 1; i >= 0; i--) if( OrderSelect(i, SELECT_BY_POS, MODE_TRADES) && OrderMagicNumber() == MN && OrderSymbol() == Symbol() ){
-
Ticket = OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice(), OrderTakeProfit(), 0, Green); if(Ticket < 0) Print("Error in Break Even : ", GetLastError());
Perhaps you should read the manual, or press F1 in the editor. OrderModify does not return a ticket; it does not return an int. The if is wrong.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
16 }
** Result compile : description = return value of 'OrderSelect' should be checked Line 6