From 75d3d1b42c910bf7aecacda002db211c5e7e2663 Mon Sep 17 00:00:00 2001 From: kenorb Date: Fri, 21 Jul 2023 21:08:33 +0100 Subject: [PATCH] Order: Fixes the current volume value when data in orequest is missing --- Order.mqh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Order.mqh b/Order.mqh index c26672ecd..0fa152773 100644 --- a/Order.mqh +++ b/Order.mqh @@ -934,7 +934,7 @@ class Order : public SymbolInfo { _request.type_filling = GetOrderFilling(odata.Get(ORDER_SYMBOL)); _request.position = oresult.deal; _request.price = SymbolInfo::GetCloseOffer(odata.Get(ORDER_TYPE)); - _request.volume = orequest.volume; + _request.volume = odata.Get(ORDER_VOLUME_CURRENT); Order::OrderSend(_request, oresult, oresult_check); switch (oresult.retcode) { case TRADE_RETCODE_DONE: @@ -1589,6 +1589,7 @@ class Order : public SymbolInfo { #endif // Update double values. _result &= Refresh(ORDER_PRICE_OPEN); + _result &= Refresh(ORDER_VOLUME_INITIAL); // Update string values. _result &= Refresh(ORDER_SYMBOL); _result &= Refresh(ORDER_COMMENT); @@ -1616,6 +1617,7 @@ class Order : public SymbolInfo { _result &= Refresh(ORDER_PRICE_CURRENT); _result &= Refresh(ORDER_SL); _result &= Refresh(ORDER_TP); + _result &= Refresh(ORDER_VOLUME_CURRENT); } //} else if (IsPending()) // _result &= Refresh(ORDER_PRICE_STOPLIMIT); // @fixme: Error 69539 @@ -1803,6 +1805,9 @@ class Order : public SymbolInfo { case ORDER_VOLUME_CURRENT: _result = Order::OrderGetDouble(ORDER_VOLUME_CURRENT, _value); break; + case ORDER_VOLUME_INITIAL: + _result = Order::OrderGetDouble(ORDER_VOLUME_INITIAL, _value); + break; default: return false; }