EA31337 / EA31337-classes

📦📈 EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)
https://ea31337.github.io/EA31337-classes
GNU General Public License v3.0
178 stars 97 forks source link

Orders are opened, instead of being closed #707

Closed kenorb closed 11 months ago

kenorb commented 11 months ago

For some reason on Order::OrderClose, we're losing value for request.position, and MT5 opens the new order, instead of closing the existing one. It's a side effect of using ambiguous TRADE_ACTION_DEAL action in MT5 for both opening and closure of the orders/positions/trades/whatever, this didn't happen when closing tickets in MT4, because it was much clearer. Using ambitious action for both operations only increases risk that it can happen again.