MT5 · Trade return codes
MT5 10039 · A close order already exists for a specified position. This may happen when working in the hedging system: when attempting to close a position with an opposite one, while close orders for the position already exist when attempting to fully or partially close a position if the total volume of the already present close orders and the newly placed one exceeds the current position volume | YI GOLD
TRADE_RETCODE_CLOSE_ORDER_EXIST
Official meaning
A close order already exists for a specified position. This may happen when working in the hedging system: when attempting to close a position with an opposite one, while close orders for the position already exist when attempting to fully or partially close a position if the total volume of the already present close orders and the newly placed one exceeds the current position volume
Possible causes · YI GOLD suggestions
Volume falls outside symbol minimum, maximum, step or directional aggregate limits.
Troubleshooting · YI GOLD suggestions
Read volume_min, volume_max, volume_step and volume_limit for the actual symbol. Round down to the step; do not send an order below minimum volume.