Long Position: (Position Closing Price-Position Opening Price) * (Margin*Leverage/Position Opening Price)
Short Position: (Position Opening Price-Position Closing Price) * (Margin*Leverage/Position Opening Price)
Bob opens both long and short positions when BTC reaches 50000USDT and adds 10x leverage with 500USDT margin. And he closes both positions when BTC reaches 52000USDT. Below are the details about his profit and loss:
Profit: （52000-50000）*（500*10/50000) = 200USDT
Loss: （50000-52000）*（500*10/50000) = -200USDT
Note: you can check profit or loss details on the trading page directly. This formula is for you to know better about how the system works.