module QuestradeClient::Symbol

Public Instance Methods

symboloptions(symbolid) click to toggle source

Retrieves an option chain for a particular underlying symbol.

Docs: www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id-options

@return [Array] List of option chain data for symbol @param [Integer] Symbol id to find options for @example

client.symboloptions(9292)
# File lib/questrade_client/symbol.rb, line 47
def symboloptions(symbolid)
    get("/symbols/#{symbolid}/options")['optionChain']
end
symbols(args) 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 symbol data @param args [Int|Array] The ID of the symbol, or a list of symbol ids or names @example

client.symbols(9292)
client.symbols(['BMO', 'SHOP', 'VTI'])
client.symbols([9292, 8089])
# File lib/questrade_client/symbol.rb, line 14
def symbols(args)
  if args.is_a?(Integer)
    get("/symbols/#{args}")['symbols']
  elsif args.length > 1 && args.first.is_a?(String)
    get("/symbols?names=#{args.join(',')}")['symbols']
  elsif args.length > 1 && args.first.is_a?(Integer)
    get("/symbols?ids=#{args.join(',')}")['symbols']
  else
    fail "Malformed argument: #{args}"
  end
end
symbolsearch(prefix, offset=nil) click to toggle source

Retrieves symbol(s) using several search criteria.

Docs: www.questrade.com/api/documentation/rest-operations/market-calls/symbols-search

@return [Array] List of symbol data FIXME: add offset @param prefix [String] Prefix to use in search @example

client.symbolsearch('BMO')
# File lib/questrade_client/symbol.rb, line 35
def symbolsearch(prefix, offset=nil)
    get("/symbols/search?prefix=#{prefix}")['symbols']
end