Module: QuestradeClient::Symbol
- Included in:
- Client
- Defined in:
- lib/questrade_client/symbol.rb
Instance Method Summary collapse
-
#symboloptions(symbolid) ⇒ Array[Hash]
Retrieves an option chain for a particular underlying symbol.
-
#symbols(args) ⇒ Array[Hash]
Retrieves the accounts associated with the user on behalf of which the API client is authorized.
-
#symbolsearch(prefix, offset = nil) ⇒ Array[Hash]
Retrieves symbol(s) using several search criteria.
Instance Method Details
#symboloptions(symbolid) ⇒ Array[Hash]
Retrieves an option chain for a particular underlying symbol.
Docs: www.questrade.com/api/documentation/rest-operations/market-calls/symbols-id-options
47 48 49 |
# File 'lib/questrade_client/symbol.rb', line 47 def (symbolid) get("/symbols/#{symbolid}/options")['optionChain'] end |
#symbols(args) ⇒ Array[Hash]
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
14 15 16 17 18 19 20 21 22 23 24 |
# 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) ⇒ Array[Hash]
Retrieves symbol(s) using several search criteria.
Docs: www.questrade.com/api/documentation/rest-operations/market-calls/symbols-search
FIXME: add offset
35 36 37 |
# File 'lib/questrade_client/symbol.rb', line 35 def symbolsearch(prefix, offset=nil) get("/symbols/search?prefix=#{prefix}")['symbols'] end |