Find the market price closest to a certain datetime and for specific assets.
closest_market_price(
asset,
datetime,
market_prices,
price_only = FALSE,
exact = FALSE,
substitute_datetime = FALSE
)
Character vector of assets' names to look for.
POSIXct of the datetime at which looking for the asset's price.
Data frame containing the market prices.
Logical. If TRUE then only the price is returned.
Logical. If TRUE then it looks for market prices at the same datetime only, otherwise it looks for the nearest before the datetime.
Logical. If TRUE the datetime is substituted with the datetime argument.
The data frame of closest market prices.
evaluate
,
lubridate::round_date