From 73d8ebc31b79a5d69a5a064a5470f6a9a7398e8c Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 30 Jul 2023 15:52:44 +0100 Subject: [PATCH] Order: Improves retcode on invalid request --- Order.mqh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) {