getSymbols.cfe: Load Data from the CBOE Futures Exchange website...

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

View source: R/getSymbols.cfe.R

Description

Load Data from the CBOE Futures Exchange website

Usage

1
2
3
4
  getSymbols.cfe(Symbols, Months = NULL, Years = NULL,
    from = "2004-06-01", to = Sys.Date(),
    nonzero.close = TRUE, rescale = TRUE, env,
    return.class = "xts", index.class = "Date", ...)

Arguments

Symbols

vector of names of instruments formated like e.g. "VX_U09", "GV_Z10", etc. OR if Months and Years are provided a vector of names of root symbols, eg. "VX","GV",etc.

Months

optional vector of months. Can be numerical or the names of the months in English. If any element of Symbols contains an underscore, this will be ignored.

Years

optional vector of years. Can either be 2 or 4 digits each. If any element of Symbols contains an underscore, this will be ignored.

from

retrieve data no earlier than this data (2004-06-01)

to

retrieve data through this data (Sys.Date())

nonzero.close

if TRUE rows where ‘Close’ is zero will be removed.

rescale

Should data from before March 26, 2007 be adjusted? See Details and References. Only applicable if Symbols is "VX" or "DV".

env

where to create objects (.GlobalEnv)

return.class

class of returned object

index.class

class of returned object index (xts only)

...

additional arguments

Details

Download Symbols to specified env from ‘cfe.cboe.com’. This method is not to be called directly; instead, a call to getSymbols(symbols, src='cfe') will in turn call this method. This is a wrapper to get end-of-day historical data for the futures that are, or have been, listed on the CBOE Futures Exchange.

Symbols can be a vector of symbols formatted like VX_U11, or GV_M10. Alternatively, the symbol roots can be used (e.g. 'VX', 'GV') and values can be provided for Months and Years. If roots are provided, but Years and Months is NULL, the current year as reported by Sys.Date() will be used, and either the current month, or, for "VT" and "VA" (which are quarterly contracts), the month of the end of the last quarter, or, for "RPXC", (which is biannual), the most recent March or Sep contract. See examples.

The raw data will contain zero values for the first few rows. Also, the last row will have zeros in every column except the ‘Settle’ column. By default, these rows, along with any other rows that have a zero Close price will be removed. If you would like to keep these rows (e.g. if you need the final settlement value) use nonzero.close=FALSE.

On March 26, 2007, The prices of VX and DV futures contracts were rescaled (divided by 10) “to bring the traded futures contract prices in line with the underlying index values...” If rescale=TRUE (Default) prices for these instruments from prior to March 26, 2007 will be divided by 10 ("rescaled"). See References.

Value

will load data into the specified environment – one object for each file downloaded.

Note

Currently listed contracts:

Delisted contracts:

Author(s)

Garrett See, based on Jeff Ryan's quantmod framework

References

http://cfe.cboe.com/Data/HistoricalData.aspx#VT,

http://tinyurl.com/CFE-VIX-VXN-Rescaling

See Also

remove_zero_rows for removing rows where a column has zero values. getSymbols, setSymbolLookup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
getSymbols(c("VX_U11", "VX_V11"),src='cfe')
#all contracts expiring in 2010 and 2011.
getSymbols("VX",Months=1:12,Years=2010:2011,src='cfe')
#getSymbols("VX",Months=1:12,Years=10:11,src='cfe') #same
#The contracts expiring this month:
getSymbols(c("VM","GV"),src='cfe')

setSymbolLookup(VX='cfe') #so we don't have to specify src anymore
getSymbols("VX",Months=1:3,Years=2005)

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.