Skip to content

πŸ“ˆ Get Current Profit/LossΒΆ

Helper method: retrieves current floating profit/loss for all open positions.

API Information:

  • Sugar method: MT5Sugar.getProfit()
  • Returns: double - Current profit/loss
  • Underlying: MT5Service.getProfit()

⬆️ OutputΒΆ

Returns: double - Profit/loss in account currency (positive = profit, negative = loss)

Throws: ApiExceptionMT5 if request fails


πŸ”— Usage ExampleΒΆ

double profit = sugar.getProfit();
System.out.printf("Current P/L: $%.2f%n", profit);

See alsoΒΆ