Class that implements the API methods for the Binance Spot API.
Super class
binance::Binance
-> BinanceSpot
Methods
Inherited methods
binance::Binance$check_server_time()
binance::Binance$get_exchange_info()
binance::Binance$kline()
binance::Binance$old_trade_lookup()
binance::Binance$order_book()
binance::Binance$price_ticker()
binance::Binance$print()
binance::Binance$recent_trades_list()
binance::Binance$sign_in()
binance::Binance$test_connectivity()
binance::Binance$ticker_stats_24hr()
Method new()
Usage
BinanceSpot$new(testnet = FALSE)
Method aggregate_trades_list()
Usage
BinanceSpot$aggregate_trades_list(
symbol,
from_id = NULL,
start_time = NULL,
end_time = NULL,
limit = 500
)
Arguments
symbol
(
character
) the trading symbol.from_id
(
numeric
) trade id to fetch from. Default isNULL
.start_time
(
numeric
) the start time for the klines in epoch milliseconds.end_time
(
numeric
) the end time for the klines in epoch milliseconds.limit
(
integer
) the number of results to return. Default is500
; max is1000
.
Method get_ui_kline_data()
Usage
BinanceSpot$get_ui_kline_data(
symbol,
interval,
start_time = NULL,
end_time = NULL,
time_zone = "0",
limit = 500
)
Arguments
symbol
(
character
) the trading symbol.interval
(
character
) the interval for the klines.start_time
(
numeric
) the start time for the klines in epoch milliseconds.end_time
(
numeric
) the end time for the klines in epoch milliseconds.time_zone
(
character
) the time zone. Default is "0" (UTC).limit
(
integer
) the number of results to return. Default is500
; max is1000
.
Method order_book_ticker()
Returns
(tibble
) a tibble with the price ticker data.
Rolling window price change statistics
Note: This method is different from the ticker_stats_24hr
method.
The window used to compute statistics will be no more than 59999ms from the requested windowSize.
openTime for this method always starts on a minute, while the closeTime is the current time of the request.
As such, the effective window will be up to 59999ms wider than windowSize.
E.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC),
and the windowSize is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00 UTC)
Method price_change_stats()
Arguments
symbols
(
character
) the trading symbols.window_size
(
character
) the window size for the statistics. Default is "1d". Supported windowSize values: 1m,2m....59m for minutes 1h, 2h....23h - for hours 1d...7d - for days Units cannot be combined (e.g. 1d2h is not allowed).type
(
character
) the type of statistics. Default is "FULL"; Supported values are "FULL" or "MINI".