CandleAverage {candlesticks} | R Documentation |
Calculates the average value of different price levels within a price bar.
OHLC_Average(TS) HLC_Average(TS) HL_Average(TS)
TS |
xts Time Series containing Open and Close Prices |
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
A xts object containing the corresponding column:
OHLC_Average |
|
HLC_Average |
|
HL_Average |
Andreas Voellenklee
## 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)