download_stocks_period: Download stock data

Description Usage Arguments Value Examples

Description

Downloads stock data for the period specified

Usage

1
2
3
4
download_stocks_period(start = lubridate::today() - 8,
  end = lubridate::today(), exchange = c("both", "nse", "bse"),
  dest_path = "./data", compile = TRUE, delete_component_files = TRUE,
  quiet = FALSE)

Arguments

start

The date from which you want the data. Defaults to lubridate::today() - 8 (8 days before today).

end

The date till which you want the data. Defauts to lubridate::today().

exchange

Choose one from "both", "nse" or "bse". Defaults to "both".

dest_path

The path you want the downloaded files to go in. Defaults to the data folder in the current working directory.

compile

If FALSE, the individual downloaded files are retained and not compiled into one large file. If TRUE, the files are compiled into one large file. You can choose whether to retain just the compiled file or not, using the delete_component_files parameter. If there are other nse or bse files, even they are compiled into one and Defaults to TRUE.

delete_component_files

Works only if compile is TRUE. If TRUE, only the compiled file will be retained. If FALSE, all the individual component files will be retained.

quiet

Controls the download status message. If you do not want the download status on each day, TRUE should be specified. Defaults to FALSE.

Value

If compile is TRUE, the compiled dataframe is returned. If FALSE, the files are just downloaded and nothing is returned.

Examples

1
download_stocks_period(start = "2018-07-24", end = "2018-07-26", exchange = "bse", compile = FALSE)

ilangurudev/IndianStocksR documentation built on May 12, 2019, 4:36 a.m.