Class Balances

java.lang.Object
com.jquestrade.Balances

public class Balances extends Object
Represents the overall encompassing balance for an account. Has methods to access per-currency blalances and combined balances.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Represents a currency.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an account's total balance in the given currency.
    Returns the balance for a particular currency's side of the account.
    i.e.
    Returns the account's total balance in the given currency at the start-of-day of the most recent trading day.
    Example: If you get an accounts balances at 3PM EST on a weekday, this start-of-day balance will represent the balance at the beginning of that day (in other words, your closing balance of the previous trading day).
    Returns the balance for a particular currency's side of the account at the start-of-day of the most recent trading day.
    Example: If you get an accounts balances at 3PM EST on a weekday, this start-of-day balance will represent the balance at the beginning of that day (in other words, your closing balance of the previous trading day).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getPerCurrencyBalances

      public Balance getPerCurrencyBalances(Balances.Currency currency)
      Returns the balance for a particular currency's side of the account.
      i.e. getPerCurrencyBalances(Currency.CAD) would return a Balance object that represents only the CAD in the account.
      Parameters:
      currency - Which currency to get the account balance for.
      Returns:
      A Balance object representing only the account's balance that is in the given currency.
    • getCombinedBalances

      public Balance getCombinedBalances(Balances.Currency currency)
      Returns an account's total balance in the given currency.
      Parameters:
      currency - Which currency to get the total account balance for.
      Returns:
      A Balance object representing the account's total balance, displayed the given currency.
    • getSodPerCurrencyBalances

      public Balance getSodPerCurrencyBalances(Balances.Currency currency)
      Returns the balance for a particular currency's side of the account at the start-of-day of the most recent trading day.
      Example: If you get an accounts balances at 3PM EST on a weekday, this start-of-day balance will represent the balance at the beginning of that day (in other words, your closing balance of the previous trading day).
      Parameters:
      currency - Which currency to get the start-of-day account balance for.
      Returns:
      A Balance object representing only the account's start-of-day balance that is in the given currency.
    • getSodCombinedBalances

      public Balance getSodCombinedBalances(Balances.Currency currency)
      Returns the account's total balance in the given currency at the start-of-day of the most recent trading day.
      Example: If you get an accounts balances at 3PM EST on a weekday, this start-of-day balance will represent the balance at the beginning of that day (in other words, your closing balance of the previous trading day).
      Parameters:
      currency - Which currency to represent the start-of-day total account balance in.
      Returns:
      A Balance object representing the account's start-of-day total balance, displayed the given currency.