R/ClOp.R

Defines functions ClOp

Documented in ClOp

#' Close to Open return
#' 
#' Calculates returns from previous days' closes to current days' opens
#' 
#' @param x an xts object with Close and Open columns
#' @return an xts object of returns
#' @author Garrett See
#' @seealso OpOp, ClCl, OpCl
#' @examples
#' \dontrun{
#' getSymbols("SPY")
#' ClOp(SPY)
#' }
#' @export
ClOp <-
function(x)
{
	xx <- Delt(Lag(Cl(x)),Op(x))
	colnames(xx) <- paste("ClOp", deparse(substitute(x)), sep='.')
	xx
}

Try the qmao package in your browser

Any scripts or data that you put into this service are public.

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