diff --git a/Order.mqh b/Order.mqh index 4b8fe6d48..10c994441 100644 --- a/Order.mqh +++ b/Order.mqh @@ -952,7 +952,7 @@ class Order : public SymbolInfo { // break; case TRADE_RETCODE_INVALID: default: - odata.Set(ORDER_PROP_LAST_ERROR, oresult.retcode); + odata.Set(ORDER_PROP_LAST_ERROR, fmax(oresult.retcode, oresult_check.retcode)); if (OrderSelect()) { Refresh(true); if (!IsClosed()) {