Skip to content

πŸ”’ Get Used MarginΒΆ

Helper method: retrieves currently used margin (locked funds for open positions).

API Information:

  • Sugar method: MT5Sugar.getMargin()
  • Returns: double - Used margin
  • Underlying: MT5Service.getMargin()

⬆️ OutputΒΆ

Returns: double - Used margin in account currency

Throws: ApiExceptionMT5 if request fails


πŸ”— Usage ExampleΒΆ

double margin = sugar.getMargin();
System.out.printf("Used margin: $%.2f%n", margin);

See alsoΒΆ