A position can be closed only when the market you are trading is open.
If you click the ‘Close’ button when the market is closed (for example, during weekends or market breaks), this will create an order to close the trade when the market re-opens. The position line will show 'Pending Close' until the market re-opens. The position will then close at the first available rate in the market.
While a position is in ‘Pending Close’ status, you have the option to click the 'Cancel' button in order to keep the position open.
‘Pending Close’ also happens for copies, when you stop copying a trader who is trading markets that are closed at that moment.