Skip to content

Commit

Permalink
Order: Fixes issues with symbol being NULL after orders were loaded f…
Browse files Browse the repository at this point in the history
…rom the existing pool

Refs: EA31337/EA31337/issues/366
  • Loading branch information
kenorb committed Jul 21, 2023
1 parent dd43b94 commit 1e585d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Order.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,13 @@ class Order : public SymbolInfo {
MqlTradeResult _result = {0};
_request.action = TRADE_ACTION_DEAL;
_request.comment = _comment + ":" + odata.GetCloseComment();
_request.deviation = orequest.deviation;
_request.magic = orequest.magic; // @todo: Add to odata, in case it has been changed.
_request.symbol = orequest.symbol;
_request.type = NegateOrderType(orequest.type);
_request.type_filling = GetOrderFilling(orequest.symbol);
_request.deviation = orequest.deviation > 0 ? orequest.deviation : 40;
_request.magic = odata.Get<ulong>(ORDER_MAGIC);
_request.symbol = odata.Get(ORDER_SYMBOL);
_request.type = NegateOrderType(odata.Get<ENUM_ORDER_TYPE>(ORDER_TYPE));
_request.type_filling = GetOrderFilling(odata.Get(ORDER_SYMBOL));
_request.position = oresult.deal;
_request.price = SymbolInfo::GetCloseOffer(orequest.type);
_request.price = SymbolInfo::GetCloseOffer(odata.Get<ENUM_ORDER_TYPE>(ORDER_TYPE));
_request.volume = orequest.volume;
Order::OrderSend(_request, oresult, oresult_check);
switch (oresult.retcode) {
Expand Down

0 comments on commit 1e585d8

Please sign in to comment.