Module: Bitfinex::RESTv2Trading
- Included in:
- RESTv2
- Defined in:
- lib/rest/v2/trading.rb
Instance Method Summary collapse
-
#active_positions ⇒ Object
Get active positions.
-
#books(symbol = "btcusd", precision = "P0", params = {}) ⇒ Hash
The Order Books channel allow you to keep track of the state of the Bitfinex order book.
-
#candles(symbol = 'tBTCUSD', timeframe = '1m', section = "hist", params = {}) ⇒ Array
Provides a way to access charting candle info.
-
#trades(symbol = "tBTCUSD", params = {}) ⇒ Array
Trades endpoint includes all the pertinent details of the trade, such as price, size and time.
Instance Method Details
#active_positions ⇒ Object
Get active positions
return [Array]
@example:
client.active_positions
74 75 76 |
# File 'lib/rest/v2/trading.rb', line 74 def active_positions authenticated_post("auth/r/positions").body end |
#books(symbol = "btcusd", precision = "P0", params = {}) ⇒ Hash
The Order Books channel allow you to keep track of the state of the Bitfinex order book. It is provided on a price aggregated basis, with customizable precision.
@example:
client.orderbook("btcusd")
44 45 46 47 |
# File 'lib/rest/v2/trading.rb', line 44 def books(symbol="btcusd", precision="P0", params = {}) check_params(params, %i{len}) get("book/#{symbol}/#{precision}", params: params).body end |
#candles(symbol = 'tBTCUSD', timeframe = '1m', section = "hist", params = {}) ⇒ Array
Provides a way to access charting candle info
@example:
client.candles('tBTCUSD')
20 21 22 23 |
# File 'lib/rest/v2/trading.rb', line 20 def candles(symbol = 'tBTCUSD', timeframe = '1m', section = "hist", params = {}) check_params(params, %i{limit start end sort}) get("candles/trade:#{timeframe}:#{symbol}/#{section}", params).body end |
#trades(symbol = "tBTCUSD", params = {}) ⇒ Array
Trades endpoint includes all the pertinent details of the trade, such as price, size and time.
@example:
client.trades("tETHUSD")
63 64 65 66 |
# File 'lib/rest/v2/trading.rb', line 63 def trades(symbol="tBTCUSD", params={}) check_params(params, %i{limit start end sort}) get("trades/#{symbol}", params).body end |