R/CandleBodyLength.R

#' Determine candle body length using a OHLC price series
#'
#' @param x OHLC prices.
#' @return length of candle body
#' @export


CandleBodyLength <- function(x) {
  BL <- abs(quantmod::Op(x) - quantmod::Cl(x))
  result <- xts::reclass(BL, x)
  colnames(result) <- "CandleBodyLength"
  return(result)
}
kochiuyu/CandleStickPattern documentation built on May 17, 2019, 4:22 a.m.