From aab0a45f155b6bcbcf772b54bbea9cb32b3f6af8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 21 May 2023 01:03:20 +0100 Subject: [PATCH] Order: Adds missing order filling (fixes GH-664) --- Order.mqh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Order.mqh b/Order.mqh index 466d81b7e..1db95c954 100644 --- a/Order.mqh +++ b/Order.mqh @@ -902,6 +902,7 @@ class Order : public SymbolInfo { _request.position = ::PositionGetInteger(POSITION_TICKET); _request.symbol = ::PositionGetString(POSITION_SYMBOL); _request.type = NegateOrderType((ENUM_POSITION_TYPE)::PositionGetInteger(POSITION_TYPE)); + _request.type_filling = GetOrderFilling(_request.symbol); _request.volume = _lots; _request.price = _price; _request.deviation = _deviation; @@ -924,10 +925,11 @@ class Order : public SymbolInfo { _request.action = TRADE_ACTION_DEAL; _request.comment = _comment != "" ? _comment : odata.GetReasonCloseText(); _request.deviation = orequest.deviation; + _request.symbol = orequest.symbol; _request.type = NegateOrderType(orequest.type); + _request.type_filling = GetOrderFilling(orequest.symbol); _request.position = oresult.deal; _request.price = SymbolInfo::GetCloseOffer(orequest.type); - _request.symbol = orequest.symbol; _request.volume = orequest.volume; Order::OrderSend(_request, oresult, oresult_check); if (oresult.retcode == TRADE_RETCODE_DONE) {