module QuestradeClient::Account

Public Instance Methods

accounts() click to toggle source

Retrieves the accounts associated with the user on behalf of which the API client is authorized.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts

@return [Array] List of accounts @example

client.accounts
# File lib/questrade_client/account.rb, line 22
def accounts
  get('/accounts')['accounts']
end
activities(id) click to toggle source

Retrieve account activities, including cash transactions, dividends, trades, etc.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-activities

FIXME: Add support for start and end time @return [Array] List of orders @param id [String] The ID of the account @param orderid [String] Only retrieve the order matching the specified order ID (optional) @example

client.activities(id)
# File lib/questrade_client/account.rb, line 88
def activities(id)
  get("/accounts/#{id}/activities")['activities']
end
balances(id) click to toggle source

Retrieves per-currency and combined balances for a specified account.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-balances

@return [Hash] Balance data for this account @param id [String] The ID of the account @example

client.balances(id)
# File lib/questrade_client/account.rb, line 46
def balances(id)
  get("/accounts/#{id}/balances")
end
executions(id) click to toggle source

Retrieves executions for a specific account.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-executions

FIXME: Add support for start and end time @return [Array] List of executions @param id [String] The ID of the account @example

client.executions(id)
# File lib/questrade_client/account.rb, line 59
def executions(id)
  get("/accounts/#{id}/executions")['executions']
end
orders(id, orderid = nil) click to toggle source

Retrieves orders for specified account

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-orders

FIXME: Add support for start and end time FIXME: Add support for statefilter @return [Array] List of orders @param id [String] The ID of the account @param orderid [String] Only retrieve the order matching the specified order ID (optional) @example

client.orders(id)
# File lib/questrade_client/account.rb, line 74
def orders(id, orderid = nil)
  get("/accounts/#{id}/orders#{orderid ? "/#{orderid}" : ''}")['orders']
end
positions(id) click to toggle source

Retrieves positions in a specified account.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/accounts-id-positions

@return [Array] List of positions for the account @param id [String] The ID of the account @example

client.positions(id)
# File lib/questrade_client/account.rb, line 34
def positions(id)
  get("/accounts/#{id}/positions")['positions']
end
time() click to toggle source

Retrieves current server time.

Docs: www.questrade.com/api/documentation/rest-operations/account-calls/time

@return [DateTime] Current server time in ISO format and Eastern time zone. @example

client.time
# File lib/questrade_client/account.rb, line 11
def time
   DateTime.parse(get('/time')['time'])
end