When you decide to close an open position, you can either use the Claim button (a Market margin buy or sell order will close a long or short position, respectively) or place a Limit Margin Buy or Short (the opposite of your open position) at the same amount as your open position.
When the order is completely filled, the position is closed, borrowed funds are repaid, and profit/loss will be credited to your margin wallet balance.
You can partially close a position, also known as "reducing" your position.
Basics Steps to Closing a Position
It’s possible to set a "take profit" level on an open long position of say 10 ETH (bought 10 ETH) by placing a Limit Margin Sell order at any price above your initial buy-in price. If you longed 10 ETH at $1,000, you could place a Limit Margin Sell of 10 ETH at $1,100 to close the position if the market were to reach, and fulfil, that order.
If you would like to set multiple "take profit" levels, then you could place multiple Limit Margin Sell orders that partially close the open position; e.g., a Limit Margin Sell order of 1 ETH at $1,050, another Limit Margin Sell order of 5 ETH at $1,075, and a final Limit Margin Sell order of 4 ETH at $1,100. Your position would be fully closed if all 3 Limit Margin Sell orders were fulfilled.
Closing a position occurs based on the borrowed funding’s interest rate. A position using funding at the highest rate is closed first.