get_day_avg: Get averge daily price for a given currency pair.

Description Usage Arguments Value References Examples

View source: R/public_api.R

Description

get_day_avg returns the daily average for a given currency pair calculated in one of 3 ways.

Usage

1
2
3
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)

Arguments

fsym

character. 3 letter name for coin to retreive price history for.

tsym

character. 3 letter name for how price should be reported for fsym.

end_time

character or POSIXct or POSIXt. Indicates the date data should be retrieved for. Defaults to Sys.time().

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.

Value

A tibble containing the date, fsym, tsym, and daily average price

References

https://min-api.cryptocompare.com

Examples

1
2
3
4
5
## Not run: 
# Get today's daily average of BTC in USD
get_day_avg("BTC", "USD")

## End(Not run)

blairj09/cryptor documentation built on May 23, 2019, 7:32 a.m.