get_day_avg
returns the daily average for a given currency pair calculated
in one of 3 ways.
get_day_avg(fsym, tsym, end_time = Sys.time(), exchange = "CCCAGG", avg_type = "HourVWAP", utc_hour_diff = 0, sign = FALSE, try_conversion = TRUE, app_name = NULL)
fsym | character. 3 letter name for coin to retreive price history for. |
---|---|
tsym | character. 3 letter name for how price should be reported for
|
end_time | character or POSIXct or POSIXt. Indicates the date data should
be retrieved for. Defaults to |
exchange | character. Exchange to query. Defaults to 'CCCAGG'. |
avg_type | character. Indicates the type of calculation to use. One of "HourVWAP", "MidHighLow" or "VolFVolT". |
utc_hour_diff | numeric. Hour difference between current timezone and UTC. The API returns results in UTC by default. Valid values are between -12 and 14. |
sign | logical. Should the server sign the response? Defaults to FALSE |
try_conversion | logical. Should BTC conversion be used fsym is not trading in tsym on specified exchange? Defaults to TRUE. |
app_name | character. Name of app to be passed in API request. Defaults to NULL. |
A tibble containing the date, fsym, tsym, and daily average price
https://min-api.cryptocompare.com
# NOT RUN { # Get today's daily average of BTC in USD get_day_avg("BTC", "USD") # }