It is a warning, not an error so it won't stop your code working.
It is just suggesting that you check whether the order was correctly selected.
This post should give you some more information
void OnStart() { int TrailingStop=50; //--- modifies Stop Loss price for buy order №12345 if(TrailingStop>0) { // OrderSelect(12345,SELECT_BY_TICKET); if(!OrderSelect(12345,SELECT_BY_TICKET)) { Print("Cannot select Order 12345"); return; } if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { bool res=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Blue); if(!res) Print("Error in OrderModify. Error code=",GetLastError()); else Print("Order modified successfully."); } } } }
thank you that was very helpful.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I had an EA that used to compile perfectly and had no errors, I tried everything to try and fix the problem but i would always get "return value of OrderSelect should be check" as a warning. After trying for so long to fix the issue i tried to compile the orderselect example given in the mql4 reference guide book and even that had the same warning. Am i missing something here. This is the example code from the mql4 reference book that is getting the same warning my EA is getting.