module QuestradeClient::Account
Public Instance Methods
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
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
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
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
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
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
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