Class: Bitmex::Instrument
Overview
Tradeable Contracts, Indices, and History
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#active ⇒ Array
Get all active instruments and instruments that have expired in <24hrs.
-
#all(filters = {}) {|Hash| ... } ⇒ Array
Get all instruments.
-
#composite_index(filters = { symbol: '.XBT' }) ⇒ Array
Show constituent parts of an index.
-
#indices ⇒ Array
Get all price indices.
-
#intervals ⇒ Bitmex::Mash
Return all active contract series and interval pairs.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Bitmex::Base
Instance Method Details
#active ⇒ Array
Get all active instruments and instruments that have expired in <24hrs.
19 20 21 |
# File 'lib/bitmex/instrument.rb', line 19 def active rest.get instrument_path('active') end |
#all(filters = {}) {|Hash| ... } ⇒ Array
Get all instruments
9 10 11 12 13 14 15 |
# File 'lib/bitmex/instrument.rb', line 9 def all(filters = {}, &ablock) if block_given? websocket.listen instrument: filters[:symbol], &ablock else rest.get instrument_path, params: filters end end |
#composite_index(filters = { symbol: '.XBT' }) ⇒ Array
Show constituent parts of an index.
32 33 34 |
# File 'lib/bitmex/instrument.rb', line 32 def composite_index(filters = { symbol: '.XBT' }) rest.get instrument_path('compositeIndex'), params: filters end |
#indices ⇒ Array
Get all price indices
38 39 40 |
# File 'lib/bitmex/instrument.rb', line 38 def indices rest.get instrument_path('indices') end |
#intervals ⇒ Bitmex::Mash
Return all active contract series and interval pairs
25 26 27 |
# File 'lib/bitmex/instrument.rb', line 25 def intervals rest.get instrument_path('activeIntervals') end |