ichimoku
Create an ichimoku object containing the values for all components of the Ichimoku Kinko Hyo cloud chart, ready for plotting. The object includes the candlesticks as well as the computed cloud lines: Tenkan-sen, Kijun-sen, Senkou span A, Senkou span B and Chikou span.
ichimoku(x, ...) ## S3 method for class 'ichimoku' ichimoku(x, ticker, ...) ## S3 method for class 'xts' ichimoku(x, ticker, periods = c(9, 26, 52), ...) ## S3 method for class 'matrix' ichimoku(x, ticker, periods = c(9, 26, 52), ...) ## S3 method for class 'data.frame' ichimoku(x, ticker, periods = c(9, 26, 52), ...) ## Default S3 method: ichimoku(x = NULL, ticker, ...)
x |
a data.frame or other compatible object, which includes xts, data.table, tibble, and matrix. |
... |
other arguments to be passed along. |
ticker |
(optional) specify a ticker to identify the instrument, otherwise this will be set to the name of the input object 'x'. |
periods |
a vector defining the length of periods used for the cloud, with a default of c(9, 26, 52). This parameter shoud not normally be changed as using other values would be invalid in the context of traditional Ichimoku analysis. |
Calling an ichimoku object automatically invokes its print method, which in the absence of arguments, will produce a printout of the data to the console as well as a static plot of the cloud chart to the graphical device.
For further options, including interactive charting, use plot() on the returned ichimoku object to pass further arguments for customising the chart.
Where an ichimoku object is passed to ichimoku(), the original object will be returned (with the ticker amended if the corresponding parameter is set).
An ichimoku object is returned with S3 classes of 'ichimoku' and 'data.frame'.
This object contains a date-time index, OHLC pricing data, candlestick direction, as well as the computed ichimoku cloud values, with ticker and periodicity parameters set as attributes.
Please refer to the reference vignette by running:
vignette("reference", package = "ichimoku")
cloud <- ichimoku(sample_ohlc_data) ichimoku(sample_ohlc_data, ticker = "TKR", periods = c(9, 26, 52))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.