Ichimoku Kinko Hyo
All indicators

LibraryTrend

Indicator

Ichimoku Kinko Hyo

Goichi Hosoda's Ichimoku Kinko Hyo: five lines for trend, momentum and support or resistance at once; the area between span A and span B is the cloud.

TrendOn the price4 inputsIchimoku

How it is calculated

Conversion and base are the midpoint of the highest high and lowest low over their lengths, span A their mean, span B the midpoint over the longest window, the lagging line the close. Each value at a bar comes from bars up to it; the chart only draws the spans displacement bars ahead and the lagging line as far back. The conversion line starts first, base and spans once their windows are full.

Reference: Hosoda (Ichimoku Kinko Hyo)

How to read it

Price above the cloud is read as an uptrend, below it as a downtrend, inside it as undecided. Conversion crossing base is a short term signal, and a thick cloud is stronger support or resistance than a thin one. With so many lines it lags, and in ranges it says little.

In a strategy

A strategy reads unshifted values: ctx.ind("ichimoku").span_a now is what the chart draws displacement bars ahead. To test price against the cloud under the current bar, keep the spans of the last displacement bars and use the oldest; .conversion over .base is a simple trigger.

Inputs

InputTypeDefaultRange or choices
Conversion line lengthconversionWhole number9min 1, max 5000
Base line lengthbaseWhole number26min 1, max 5000
Span B lengthspan_bWhole number52min 1, max 5000
DisplacementdisplacementWhole number26min 1, max 500

What it draws

LineDrawn as
ConversionLine
BaseLine
Span ALine
Span BLine
LaggingLine

Used in

No strategy template reads it yet.

OrionQuant