i don't get it
at first you asked a question about
order select should be checked
and i brought you the solution
next you are talking about
[...] now my old EA doesnt work beucase warning "order select should be checked"
It's on the line with orderselect. How can I repair it? Any good ideas for "warnings with checking"? thank you :))
and
GumRai
answered you
That is a warning and will not prevent your EA from "working"
It may not "work" as intended if there is an error with the OrderSelect for some reason, so check that the OrderSelect was successful and only execute the following code if it was.
now you are telling us you don't understand programming at all
thank you but not answer which I want :/ I only need function begining of code from anywhere. Is it anywhere some good tutorials for this? for create good EAs (not need strategies, I have my own) ?
which incidentally doesn't add up with what you wrote above
Hello, I didnt trade about 1 year and now my old EA doesnt work beucase warning "order select should be checked"
Hello, I didnt trade about 1 year and now my old EA doesnt work beucase warning "order select should be checked"
It's on the line with orderselect. How can I repair it? Any good ideas for "warnings with checking"? thank you :))
bool IsTrade = False;
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
IsTrade = True;
if(OrderType() == OP_BUY) {
}
}
}
It's no big deal to check it. Here is how I do it :
for(cnt=OrdersTotal()-1;cnt>=0;cnt--) { if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))//if order select fails { newError=GetLastError(); Print("Order select failed in FindLastOrderPlaced() with error : "+(string)newError+ErrorDescription(newError));//tell me the error break; } // else if order select didn't fail else { if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) { if(OrderType()==OP_BUY || OrderType()==OP_SELL) { if(OrderOpenTime()>lastOrderTime) {
Or you can just say
for(cnt=OrdersTotal()-1;cnt>=0;cnt--) { if(!OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES))//if order select fails { Print("Order select failed with error : "+(string)GetLastError());//tell me the error break; } // else if order select didn't fail else { if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) //..... your code here
You get the idea.
Hope it helps
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I didnt trade about 1 year and now my old EA doesnt work beucase warning "order select should be checked"
It's on the line with orderselect. How can I repair it? Any good ideas for "warnings with checking"? thank you :))
bool IsTrade = False;
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
IsTrade = True;
if(OrderType() == OP_BUY) {
}
}
}