2. After closing the position, use the existing actual position-principal position = profit.
3. The calculation of floating profit and loss is totally unnecessary. There is no security without liquidation, and the money is not yours. What is the profit?