Skip to contents

The first call downloads the history from start_date and keeps it on disk (see disk_cache()). Later calls use the kept history, and once it is more than an hour old download only the days since its last day, because past days do not change: one request instead of one per 400 days. A history kept from a later day than start_date is downloaded again in full, and when bringing it up to date fails, the kept history is used.

Usage

coin_history(coin, start_date)

Arguments

coin

One row of get_coins().

start_date

Date. The first day needed.

Value

The price history of the coin from start_date, or NULL when it could not be downloaded.

Examples

if (FALSE) { # \dontrun{
coins <- get_coins()
crypto:::coin_history(coins[coins$name_symbol == "Bitcoin (BTC)", ], Sys.Date() - 30)
} # }