Class: Bitmex::Quote
Overview
Best Bid/Offer Snapshots & Historical Bins Looks like all REST API methods return ‘403 Forbidden’ but Web socket API works just fine.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all(filters = {}) {|Hash| ... } ⇒ Array
Get all quotes.
-
#bucketed(bin_size = '1h', filters = {}) {|Hash| ... } ⇒ Array
Get previous quotes in time buckets.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Bitmex::Base
Instance Method Details
#all(filters = {}) {|Hash| ... } ⇒ Array
Get all quotes
10 11 12 13 14 15 16 |
# File 'lib/bitmex/quote.rb', line 10 def all(filters = {}, &ablock) if block_given? websocket.listen quote: filters[:symbol], &ablock else rest.get quotes_path, params: filters end end |
#bucketed(bin_size = '1h', filters = {}) {|Hash| ... } ⇒ Array
Get previous quotes in time buckets
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/bitmex/quote.rb', line 23 def bucketed(bin_size = '1h', filters = {}, &ablock) check_binsize bin_size if block_given? topic = { "quoteBin#{bin_size}": filters[:symbol] } websocket.listen topic, &ablock else params = filters.merge binSize: bin_size rest.get quotes_path(:bucketed), params: params end end |