Mean value of OHLC prices

Share:

Description

Calculates the average value of different price levels within a price bar.

Usage

1
2
3

Arguments

TS

xts Time Series containing Open and Close Prices

Details

The calculation of the average of the high, low, and close, is as follows:
OHLC Average = (Open + High + Low + Close) / 4
HLC Average = (High + Low + Close) / 3
HL Average = (High + Low) / 2

Value

A xts object containing the corresponding column:

OHLC_Average
HLC_Average
HL_Average

Author(s)

Andreas Voellenklee

Examples

1
2
3
4
5
6
7
8
## Not run: 
# calculate average prices for a daily OHLC price series
getSymbols('YHOO', adjust=TRUE)
head(cbind(OHLC_Average(YHOO), 
      HLC_Average(YHOO), 
      HL_Average(YHOO)))

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.