daroczig / binancer

An R client to the Public Rest API for Binance.
https://daroczig.github.io/binancer
54 stars 57 forks source link

get_kline not pulling codes from a string #2

Closed johnatasjmo closed 6 years ago

johnatasjmo commented 6 years ago

The following error when calling get_klines for a string

> prices_symbols_selected <- get_klines(c("ETHBTC", "LTCBTC"), "1d", limit = 200)
ERROR [2018-01-19 09:30:03] Binance query to api/v1/klines failed for the NAst/nd/rd/th time, retrying
Error in if (isTRUE(retry) & retries < 4) { : argument is of length zero
daroczig commented 6 years ago

Well, that's not a string but a character vector with length > 1 -- which is not supported by get_klines, but you could easily get that working, eg

> library(data.table)
> rbindlist(lapply(c("ETHBTC", "LTCBTC"), get_klines, interval = "1d", limit = 200))