Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

                                                            sha256
1 9b787ca60956d571ad9686d55815fcff38fce9d550ccb1310c0b9c11dfa8069e

An implementation in R of the Ichimoku Kinkō Hyō (一目均衡表) charting system, also commonly known as ‘cloud charts’.

The technique is a refinement on candlestick charting originating from Japan, now in widespread use in technical analysis worldwide. Translating to ‘one-glance equilibrium chart’, it allows the price action and market structure of financial securities to be determined ‘at-a-glance’.

### Example

For both publication-ready and fully-interactive charts for analysis.

Simply ichimoku() and plot().

library(ichimoku)
TKR <- sample_ohlc_data

cloud <- ichimoku(TKR)

plot(cloud, from = "2020-05-01", to = "2020-12-03")

plot(cloud, from = "2020-05-01", to = "2020-12-03", theme = "dark")

### Installation

Install the released version of ichimoku from CRAN:

install.packages("ichimoku")

Or install the development version of ichimoku from GitHub with:

devtools::install_github("shikokuchuo/ichimoku")

### Package site

Hosted ourselves at: https://shikokuchuo.net/ichimoku/

### Ichimoku Kinko Hyo

The system consists of the following chart lines added to a candlestick chart:

Tenkan-sen (転換線): [conversion line] the mid-point of the highest high and lowest low for the past 9 periods.

Kijun-sen (基準線): [base line] the mid-point of the highest high and lowest low for the past 26 periods.

Senkou span A (先行帶A): [leading span A] the mid-point of Tenkan-sen and Kijun-sen plotted ahead 26 periods.

Senkou span B (先行帶B): [leading span B] the mid-point of the highest high and lowest low for the past 52 periods, plotted ahead 26 periods.

Chikou span (遲行帶): [lagging span] the current closing price plotted 26 periods behind.

The kumo (雲) [cloud] is the area between Senkou span A and Senkou span B (usually shaded on a chart).

### Interpretation

Ichimoku Kinkō Hyō translates roughly to ‘one-glance equilibrium chart’. It is designed to allow the price action and market structure of financial securities to be determined ‘at-a-glance’ in a highly visual fashion.

For example in a strongly upwards-trending market, the candlesticks will be above the Tenkan-sen, which will be above the Kijun-sen, which will be above the cloud, and the Chikou span may not have anything above it.

The lines and the cloud represent dynamic support and resistance zones relative to the price candles. Generally the thicker the cloud, the tougher the support/resistance. In our previous example, if the price now reverts downwards, it can expect support first at the Kijun-sen, then the Tenkan-sen and finally the cloud itself.

More subtle interpretations involve the Chikou span in particular and its action in relation to the cloud lines as well as the candles.

### Context

Ichimoku analysis is the latest evolution in refining candlestick charting techniques, which also originated from Japan in the 18th century. Actually developed during the mid-20th century, it gained popularity especially from the late 1990s onwards, and is now used on trading floors worldwide.

The time periods have traditionally been calculated as 9, 26 and 52 based on manual data analysis performed in Japan in a pre-computer age where there was a 6-day working week resulting in 26 average trading days in a month. Although this bears little relevance to the current day, the use of these time periods has persisted as an ‘industry norm’ or ‘accepted practice’.

To use other periods would be meaningless in a sense as everyone uses these parameters and ‘market psychology’ can and often does create its own realities, independent of any fundamentals. However, there is no reason for the technique not to evolve, and to reflect changing trading realities perhaps other parameters will become more relevant in the collective psychology.

Finally, the use originated with daily candlesticks, and the most valid interpretation remains for daily data. However, it is equally used today for both shorter intra-day, e.g. 4-hour or hourly, and longer, e.g. weekly or monthly, charts.