Return the first date (reverse chronological order) on which the target price falling between day high and day low based on the availability of data.

fx_rate_lookup(curr, target_px)

Arguments

curr

A character vector with one element which is the ticker of the currency pair such as 'EURUSD'

target_px

A double vector with one element that is the target price for the lookup

Value

A character vector with one element. The closest date on which the target price falling between day high and day low in YYYY-MM-DD.

Examples

fx_rate_lookup('EURUSD', 1.072)
#> [1] "2023-02-10"