CurrencyPairMethods {fmbasics}R Documentation

CurrencyPair methods

Description

A collection of methods related to currency pairs.

Usage

is_t1(x)

to_spot(dates, x)

to_spot_next(dates, x)

to_forward(dates, tenor, x)

to_today(dates, x)

to_tomorrow(dates, x)

to_fx_value(dates, tenor, x)

invert(x)

Arguments

x

a CurrencyPair object

dates

a vector of dates from which forward dates are calculated

tenor

the tenor of the value date which can be one of the following: "spot", "spot_next", "today", "tomorrow" and the usual "forward" dates (e.g. lubridate::months(3))

Details

The methods are summarised as follows:

Examples

library(lubridate)
is_t1(AUDUSD())
dts <- lubridate::ymd(20170101) + lubridate::days(0:30)
to_spot(dts, AUDUSD())
to_spot_next(dts, AUDUSD())
to_today(dts, AUDUSD())
to_tomorrow(dts, AUDUSD())
to_fx_value(dts, months(3), AUDUSD())

[Package fmbasics version 0.3.0 Index]