allpairs.egcm {egcm}R Documentation

Perform cointegration tests for all pairs of securities in a list

Description

Given a list of ticker symbols, downloads the adjusted daily closing prices of each of the symbols from Yahoo, and performs a cointegration test for each pair of symbols. Returns a data.frame containing the results of the tests.

Usage

allpairs.egcm(tickers, 
  startdate = format(Sys.Date() - 365, "%Y-%m-%d"), 
  enddate =   format(Sys.Date(), "%Y-%m-%d"), clear.na.inf=TRUE, ...)

Arguments

tickers

A list of ticker symbols whose data is to be downloaded from Yahoo!. Alternatively, this may be a data.frame containing the price series to be checked, one series per column.

startdate

The starting date for which to download the data. Given in the form "YYYY-MM-DD". Defaults to one year ago.

enddate

The ending date for which to download the data. Given in the form "YYYY-MM-DD". Defaults to today.

clear.na.inf

if TRUE, NA and Inf price values are replaced by the last available price. Default:TRUE.

...

Other parameters to be passed to egcm

Value

A data.frame containing the following columns:

Author(s)

Matthew Clegg matthewcleggphd@gmail.com

See Also

egcm

Examples

## Not run: 
    # Check if any of the oil majors are cointegrated:
    allpairs.egcm(c("BP","CVX","RDS.A","TOT","XOM"))

## End(Not run)

[Package egcm version 1.0.13 Index]