R/get_trx_market_data_for_last_n_days.R
get_trx_market_data_for_last_n_days.Rd
Retrieves TRX market data for previous days
get_trx_market_data_for_last_n_days( vs_currency = "usd", days, interval = NULL, max_attempts = 3L )
vs_currency | (character): name of the base currency to benchmark TRX
against ( |
---|---|
days | (numeric or |
interval | (character or |
max_attempts | (integer, positive): specifies the
maximum number of additional attempts to call a URL if the
first attempt fails (i.e. its call status is different from
|
A tibble with the following columns:
timestamp
(POSIXct);
vs_currency
(character): same as the argument vs_currency
;
price
(double): TRX price, as of datetime
;
total_trading_vol
(double): a 24 h rolling-window trading volume, as
of datetime
;
market_cap
(double): TRX market cap, as of datetime
.
If days = 1
and interval = NULL
, the data will be presented for
every few minutes (typically 3-8 minutes). If days
is between 2 and 90
(inclusive) and interval = NULL
, an (approximately) hourly time step will
be used. Daily data are used for days
above 90. If interval = "daily"
,
daily data will be used irrespective of the value of days
.
#> # A tibble: 721 x 5 #> timestamp vs_currency price total_trading_vol market_cap #> <dttm> <chr> <dbl> <dbl> <dbl> #> 1 2021-06-12 22:01:14 gbp 0.0487 903566765. 3487634163. #> 2 2021-06-12 23:01:11 gbp 0.0486 894340986. 3478379281. #> 3 2021-06-13 00:01:41 gbp 0.0484 872891643. 3485310799. #> 4 2021-06-13 01:00:37 gbp 0.0487 866839417. 3471402650. #> 5 2021-06-13 02:06:54 gbp 0.0491 854218052. 3512810468. #> 6 2021-06-13 03:01:45 gbp 0.0486 825231596. 3487461917. #> 7 2021-06-13 04:03:45 gbp 0.0478 799819340. 3443169652. #> 8 2021-06-13 05:02:57 gbp 0.0479 794260346. 3414856192. #> 9 2021-06-13 06:04:21 gbp 0.0476 792537509. 3413766509. #> 10 2021-06-13 07:06:56 gbp 0.0477 803574787. 3418660686. #> # … with 711 more rows