Skip to content

Commit

Permalink
Order: Fixes the current volume value when data in orequest is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Jul 21, 2023
1 parent 03a74dc commit a1494b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Order.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -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<ENUM_ORDER_TYPE>(ORDER_TYPE));
_request.volume = orequest.volume;
_request.volume = odata.Get<double>(ORDER_VOLUME_CURRENT);
Order::OrderSend(_request, oresult, oresult_check);
switch (oresult.retcode) {
case TRADE_RETCODE_DONE:
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a1494b3

Please sign in to comment.