From aca431e1b195087b826f6608c5779d6f979b3330 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 15 Aug 2023 22:46:24 +0100 Subject: [PATCH] Final fix for orders are opened instead of being closed for both MT4 and MT5 (fixes GH-707) --- Order.mqh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Order.mqh b/Order.mqh index 1db95c954..3ea5c20cb 100644 --- a/Order.mqh +++ b/Order.mqh @@ -928,7 +928,7 @@ class Order : public SymbolInfo { _request.symbol = orequest.symbol; _request.type = NegateOrderType(orequest.type); _request.type_filling = GetOrderFilling(orequest.symbol); - _request.position = oresult.deal; + _request.position = odata.Get(ORDER_PROP_TICKET); _request.price = SymbolInfo::GetCloseOffer(orequest.type); _request.volume = orequest.volume; Order::OrderSend(_request, oresult, oresult_check);