shows or removes instruments of given currency denomination(s)

Share:

Description

ls_ functions get names of instruments denominated in a given currency (or currencies) rm_ functions remove instruments of a given currency

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ls_by_currency(currency, pattern = NULL, match = TRUE,
  show.currencies = FALSE)

rm_by_currency(x, currency, keep.currencies = TRUE)

ls_USD(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_AUD(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_GBP(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_CAD(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_EUR(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_JPY(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_CHF(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_HKD(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_SEK(pattern = NULL, match = TRUE, show.currencies = FALSE)

ls_NZD(pattern = NULL, match = TRUE, show.currencies = FALSE)

Arguments

currency

chr vector of names of currency

pattern

an optional regular expression. Only names matching ‘pattern’ are returned.

match

exact match?

show.currencies

include names of currency instruments in the returned names?

x

what to remove. chr vector.

keep.currencies

Do not delete currency instruments when deleting multiple instruments.

Value

ls_ functions return vector of instrument names rm_ functions return invisible / called for side-effect.

Author(s)

Garrett See

See Also

ls_instruments, ls_currencies, rm_instruments, rm_currencies, twsInstrument, instrument

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
#First create instruments
currency(c('USD','CAD','GBP')
stock(c('CM','CNQ'),'CAD')
stock(c('BET','BARC'),'GBP')
stock(c('SPY','DIA'),'USD')

#now the examples
ls_by_currency(c('CAD','GBP'))

ls_USD()
ls_CAD()

#2 ways to remove all instruments of a currency
rm_instruments(ls_USD())
#rm_instruments(ls_GBP(),keep.currencies=FALSE)
rm_by_currency( ,'CAD')
#rm_by_currency( ,'CAD', keep.currencies=FALSE)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.