Will operation of OrderSend and OrderClose successfully done but return false due to bad network in MT4?
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- Magic Number?
- Do OrderSend() and OrderClose() automatically select the current ticket?
OrderSend() returns a ticket number if successful or -1 if it fails.
So if there is no connection OrderSend() will return -1 and you can get additional information by calling the GetLastError() function.
OrderClose() returns true or false and will also return false in case of no connection.
Some robots will keep trying to close the order or will give off Alert() or Playsound() depending on how it was coded.