class Binance::Responses::Kline
- Binance::Responses::Kline
- Reference
- Object
Overview
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
- If startTime and endTime are not sent, the most recent klines are returned.
Example Usage
response = client.klines("BNBUSDT", "1h", 5)
response.klines.size # => 5
response.klines.map(&.open_price) # => [34.4949, 34.3671, 34.3842, 34.2751, 34.2592]
response.klines.map(&.close_price) # => [34.3887, 34.376, 34.2218, 34.2658, 34.2749]
response.klines[0].open_time # => "2019-06-28 17:00:00 UTC"
response.klines[0].close_time # => "2019-06-28 17:59:59 UTC"
response.klines[4].open_time # => "2019-06-28 21:00:00 UTC"
response.klines[4].close_time # => "2019-06-28 21:59:59 UTC"
Typical server response (unparsed JSON)
[
1499040000000, // Open time
"0.01634790", // Open
"0.80000000", // High
"0.01575800", // Low
"0.01577100", // Close
"148976.11427815", // Volume
1499644799999, // Close time
"2434.19055334", // Quote asset volume
308, // Number of trades
"1756.87402397", // Taker buy base asset volume
"28.46694368", // Taker buy quote asset volume
"17928899.62484339" // Ignore.
]
Defined in:
binance/client/rest/responses/kline.crInstance Method Summary
-
#base_volume : Float64
Volume expressed in the base asset
-
#close_price : Float64
Close Price (this can fluxuate for still open candles!)
-
#close_time : Time
Close Time in UTC
-
#high_price : Float64
High Price
-
#low_price : Float64
Low Price
-
#open_price : Float64
Open Price
-
#open_time : Time
Open Time in UTC
-
#quote_volume : Float64
Volume expressed in the target (quote) asset
-
#reserved : Float64
Unknown/undocumented
-
#taker_base_volume : Float64
Volume of taker trades on base asset
-
#taker_quote_volume : Float64
Volume of taker trades expressed in the target (quote) asset
-
#trades : Int64
Number of trades on asset pair in interval