closest_market_price: Closest market price

View source: R/closest_market_price.R

closest_market_priceR Documentation

Closest market price

Description

Find the market price closest to a certain datetime and for specific assets.

Usage

closest_market_price(
  asset,
  datetime,
  market_prices,
  price_only = FALSE,
  exact = FALSE,
  substitute_datetime = FALSE
)

Arguments

asset

Character vector of assets' names to look for.

datetime

POSIXct of the datetime at which looking for the asset's price.

market_prices

Data frame containing the market prices.

price_only

Logical. If TRUE then only the price is returned.

exact

Logical. If TRUE then it looks for market prices at the same datetime only, otherwise it looks for the nearest before the datetime.

substitute_datetime

Logical. If TRUE the datetime is substituted with the datetime argument.

Value

The data frame of closest market prices.

See Also

evaluate, lubridate::round_date


dispositionEffect documentation built on May 30, 2022, 9:05 a.m.