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.
-
#expirations(symbol) ⇒ Array<Date>
Obtain an underlier's expiration dates.
-
#history(symbol, options = {}) ⇒ Array<Tradier::Event>
Get historical pricing for a given symbol.
-
#quotes(symbols, options = {}) ⇒ Array<Tradier::Quote>
(also: #quote)
Obtain quotes.
-
#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
73 74 75 |
# File 'lib/tradier/api/markets.rb', line 73 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
63 64 65 |
# File 'lib/tradier/api/markets.rb', line 63 def clock(={}) object_from_response(Tradier::Clock, :get, '/markets/clock', ) end |
#expirations(symbol) ⇒ Array<Date>
Obtain an underlier's expiration dates.
41 42 43 |
# File 'lib/tradier/api/markets.rb', line 41 def expirations(symbol) object_from_response(Tradier::API::Utils::Expiration, :get, '/markets/options/expirations', :symbol => symbol).body end |
#history(symbol, options = {}) ⇒ Array<Tradier::Event>
Get historical pricing for a given symbol.
96 97 98 99 |
# File 'lib/tradier/api/markets.rb', line 96 def history(symbol, ={}) .merge!('symbol' => symbol) object_from_response(Tradier::API::Utils::History, :get, '/markets/history', ).body 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 |
#strikes(symbol, expiration) ⇒ Array<String>
Obtain an underlier's expiration strikes for an expiration date.
53 54 55 |
# File 'lib/tradier/api/markets.rb', line 53 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.
84 85 86 87 |
# File 'lib/tradier/api/markets.rb', line 84 def timesales(symbol, ={}) .merge!('symbol' => symbol) object_from_response(Tradier::API::Utils::Timesales, :get, '/markets/timesales', ).body end |