heikin_ashi: Heikin-Ashi

Description Usage Arguments Details Value Examples

View source: R/heikin_ashi.R

Description

Calculates the Heikin-Ashi values needed for plotting in a candlestick chart.

Usage

1

Arguments

x

an xts object that contains OHLC data

Details

1. The Heikin-Ashi Close is an average of the open, high, low and close for the current period.

2. The Heikin-Ashi Open is the average of the prior Heikin-Ashi open and the prior Heikin-Ashi close

3. The Heikin-Ashi High is the maximum of: the current period's high, the current Heikin-Ashi open or the current Heikin-Ashi close.

4. The Heikin-Ashi low is the minimum : the current period's low, the current Heikin-Ashi open or the current Heikin-Ashi close.

More information can be found at Investopedia

Value

The heikin_ashi function will return a OHLC dataset with the calculated heikin ashi values needed for plotting in a candlestick chart.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(quantmod)
ADM <- getSymbols("ADM", 
                  from = "2018-01-01", 
                  to = "2018-07-01", 
                  auto.assign = FALSE)
ha_ADM <- heikin_ashi(ADM)
chartSeries(ha_ADM)

## End(Not run)
 

pverspeelt/Quantfunctions documentation built on Oct. 10, 2021, 1:01 p.m.