ChangeTicker: Change the Symbol of data on disk

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

When a stock changes its ticker symbol, this function can be used to change the name of the ticker associated with the data stored on disk.

Usage

1
ChangeTicker(old.ticker, new.ticker, base_dir = "/mnt/W/")

Arguments

old.ticker

character string. The ticker the stock used to have

new.ticker

character string. The ticker the stock has now

base_dir

the base directory that contains at least some of the following subdirectories: BID, ASK, TRADES, BAT, BAM.

Details

This will load all data stored for old.ticker and change the column names to use the new ticker. Then it will save a copy of the data under the new ticker. For now, nothing is deleted, but in the future an argument may be added to allow for that.

Value

called for side-effect

Note

This does not do anything with the .instrument environment. You should update your instruments separately (e.g. change the primary_id to the new.ticker and add old.ticker as an identifier of the new instrument with add.identifier

Author(s)

Garrett See

See Also

reqTBBOhistory, instrument_attr and add.identifier for updating the .instrument environment (see note section)

Examples

1
2
3
4
5
6
## Not run: 
# If you have data stored on disk for ERTS,
# this will save a copy of it in the EA directories
ChangeTicker("ERTS", "EA", "/mnt/W/")

## End(Not run)

gsee/twsInstrument documentation built on May 17, 2019, 8:55 a.m.