Module: Tradier::API::Markets
Instance Method Summary collapse
-
#calendar(options = {}) ⇒ Tradier::Calendar
Obtain the market calendar.
-
#chains(symbol, options = {}) ⇒ Array<Tradier::OptionQuote>
(also: #chain)
Obtain an option chain.
-
#clock(options = {}) ⇒ Tradier::Clock
Obtain the market clock.
-
#etb ⇒ Array<Tradier::Security>
Retrieve the Easy-To-Borrow list.
-
#expirations(symbol, options) ⇒ Array<Date>, Array<Tradier::Expiration>
Obtain an underlier's expiration dates.
-
#history(symbol, options = {}) ⇒ Array<Tradier::Event>
Get historical pricing for a given symbol.
-
#lookup(q, options) ⇒ Array<Tradier::Security>
Lookup a symbol.
-
#markets_session(options = {}) ⇒ Tradier::EventSession
Create a streaming session.
-
#quotes(symbols, options = {}) ⇒ Array<Tradier::Quote>
(also: #quote)
Obtain quotes.
-
#search(q, options) ⇒ Array<Tradier::Security>
Search for a stock symbol using a keyword lookup.
-
#strikes(symbol, expiration) ⇒ Array<String>
Obtain an underlier's expiration strikes for an expiration date.
-
#timesales(symbol, options = {}) ⇒ Array<Tradier::Timesales>
Get time and sales for a given symbol.
Instance Method Details
#calendar(options = {}) ⇒ Tradier::Calendar
Obtain the market calendar
77 78 79 |
# File 'lib/tradier/api/markets.rb', line 77 def calendar(={}) object_from_response(Tradier::Calendar, :get, '/markets/calendar', ) end |
#chains(symbol, options = {}) ⇒ Array<Tradier::OptionQuote> Also known as: chain
Obtain an option chain.
28 29 30 31 |
# File 'lib/tradier/api/markets.rb', line 28 def chains(symbol, ={}) .merge!('symbol' => symbol) object_from_response(Tradier::API::Utils::OptionQuote, :get, '/markets/options/chains', ).body end |
#clock(options = {}) ⇒ Tradier::Clock
Obtain the market clock
67 68 69 |
# File 'lib/tradier/api/markets.rb', line 67 def clock(={}) object_from_response(Tradier::Clock, :get, '/markets/clock', ) end |
#etb ⇒ Array<Tradier::Security>
Retrieve the Easy-To-Borrow list.
148 149 150 |
# File 'lib/tradier/api/markets.rb', line 148 def etb object_from_response(Tradier::API::Utils::Security, :get, '/markets/etb').body end |
#expirations(symbol, options) ⇒ Array<Date>, Array<Tradier::Expiration>
Obtain an underlier's expiration dates.
44 45 46 47 |
# File 'lib/tradier/api/markets.rb', line 44 def expirations(symbol, ={}) .merge!(:symbol => symbol) object_from_response(Tradier::API::Utils::Expiration, :get, '/markets/options/expirations', ).body end |
#history(symbol, options = {}) ⇒ Array<Tradier::Event>
Get historical pricing for a given symbol.
100 101 102 103 |
# File 'lib/tradier/api/markets.rb', line 100 def history(symbol, ={}) .merge!('symbol' => symbol) object_from_response(Tradier::API::Utils::History, :get, '/markets/history', ).body end |
#lookup(q, options) ⇒ Array<Tradier::Security>
Lookup a symbol.
138 139 140 141 |
# File 'lib/tradier/api/markets.rb', line 138 def lookup(q, ={}) .merge!('q' => q) object_from_response(Tradier::API::Utils::Security, :get, '/markets/lookup', ).body end |
#markets_session(options = {}) ⇒ Tradier::EventSession
Create a streaming session
111 112 113 |
# File 'lib/tradier/api/markets.rb', line 111 def markets_session(={}) object_from_response(Tradier::EventSession, :post, '/markets/events/session', ) end |
#quotes(symbols, options = {}) ⇒ Array<Tradier::Quote> Also known as: quote
Obtain quotes.
15 16 17 18 |
# File 'lib/tradier/api/markets.rb', line 15 def quotes(symbols, ={}) .merge!('symbols' => normalized_symbols(symbols)) object_from_response(Tradier::API::Utils::Quote, :get, '/markets/quotes', ).body end |
#search(q, options) ⇒ Array<Tradier::Security>
Search for a stock symbol using a keyword lookup.
124 125 126 127 |
# File 'lib/tradier/api/markets.rb', line 124 def search(q, ={}) .merge!('q' => q) object_from_response(Tradier::API::Utils::Security, :get, '/markets/search', ).body end |
#strikes(symbol, expiration) ⇒ Array<String>
Obtain an underlier's expiration strikes for an expiration date.
57 58 59 |
# File 'lib/tradier/api/markets.rb', line 57 def strikes(symbol, expiration) object_from_response(Tradier::API::Utils::Strike, :get, '/markets/options/strikes', :symbol => symbol, :expiration => expiration).body end |
#timesales(symbol, options = {}) ⇒ Array<Tradier::Timesales>
Get time and sales for a given symbol.
88 89 90 91 |
# File 'lib/tradier/api/markets.rb', line 88 def timesales(symbol, ={}) .merge!('symbol' => symbol) object_from_response(Tradier::API::Utils::Timesales, :get, '/markets/timesales', ).body end |