Module: Bibox::Rest::Public::Klines

Included in:
Client
Defined in:
lib/bibox/rest/public/klines.rb

Instance Method Summary collapse

Instance Method Details

#klines(pair: "BIX_ETH", period: '1min', size: 1_000, options: {}) ⇒ Object

Size: number of data points to return (1000 is maximum)



12
13
14
15
16
17
# File 'lib/bibox/rest/public/klines.rb', line 12

def klines(pair: "BIX_ETH", period: '1min', size: 1_000, options: {})
  path        =   "/mdata"
  params      =   {cmd: "kline", pair: pair, period: period, size: size}
  response    =   parse(get(path, params: params, options: options))&.fetch("result", {})
  ::Bibox::Models::OHLCV.parse(response) if response
end