Learn R Programming

FinancialInstrument (version 1.3.1)

exchange_rate: constructor for spot exchange rate instruments

Description

Currency symbols (like any symbol) may be any combination of alphanumeric characters, but the FX market has a convention that says that the first currency in a currency pair is the 'target' and the second currency in the symbol pair is the currency the rate ticks in. So 'EURUSD' can be read as 'USD per 1 EUR'.

Usage

exchange_rate(primary_id = NULL, currency = NULL, counter_currency = NULL,
  tick_size = 0.01, identifiers = NULL, assign_i = TRUE,
  overwrite = TRUE, ...)

Arguments

primary_id

string identifier, usually expressed as a currency pair 'USDYEN' or 'EURGBP'

currency

string identifying the currency the exchange rate ticks in

counter_currency

string identifying the currency which the rate uses as the base 'per 1' multiplier

tick_size

minimum price change

identifiers

named list of any other identifiers that should also be stored for this instrument

assign_i

TRUE/FALSE. Should the instrument be assigned in the .instrument environment? (Default TRUE)

overwrite

TRUE by default. If FALSE, an error will be thrown if there is already an instrument defined with the same primary_id.

...

any other passthru parameters

Details

In FinancialInstrument the currency of the instrument should be the currency that the spot rate ticks in, so it will typically be the second currency listed in the symbol.

Thanks to Garrett See for helping sort out the inconsistencies in different naming and calculating conventions.

References

http://financial-dictionary.thefreedictionary.com/Base+Currency