You can only withdraw amounts up to the free margin available in your trading accounts. It is usually recommended to request withdrawal while you do not have any open trades.
However, in case you do have any open trades, you have to examine the most quantity which you would really like to withdraw. In case you do not have sufficient available margin in the trading account, the request can be denied.