From e891a0798e55f25e1d9e4d57653fe0b9844a8fdf 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Order.mqh b/Order.mqh index dfcd7979c..b843ffe3f 100644 --- a/Order.mqh +++ b/Order.mqh @@ -455,6 +455,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; @@ -476,10 +477,11 @@ class Order : public SymbolInfo { _request.action = TRADE_ACTION_DEAL; _request.comment = _comment; _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.price = SymbolInfo::GetCloseOffer(orequest.type); _request.volume = orequest.volume; Order::OrderSend(_request, oresult, oresult_check); if (oresult.retcode == TRADE_RETCODE_DONE) {