Ichimoku trading strategy (the cloud, rules and code)
Ichimoku Kinko Hyo — “one glance equilibrium chart” — looks intimidating: five lines and a shaded cloud draped over price. But it's really a single, self-contained trend system that answers trend, support/resistance, momentum and confirmation in one view. The cloud (Kumo) is the heart of it. This guide demystifies the five lines, gives the exact long/short rules, shows the code, and is honest about why Ichimoku lags in fast reversals.
The five lines, demystified
- Tenkan-sen (conversion, 9) — midpoint of the 9-period high/low; the fast line.
- Kijun-sen (base, 26) — midpoint of the 26-period high/low; the slow line and a dynamic stop.
- Senkou Span A & B — projected forward 26 periods; the gap between them is the cloud.
- Chikou (lagging) span — the current close plotted 26 periods back, used to confirm.
The Kumo cloud is the whole story
Price above the cloud = uptrend; below = downtrend; inside = no-trade chop. The cloud's thickness is future support/resistance — a thick cloud is hard to break, a thin one is fragile. Because the cloud is projected 26 periods ahead, it gives a forward read on where support and resistance will sit.
The trade rules
- Long — price above the cloud, Tenkan crosses above Kijun (the TK cross), and the Chikou span is above price 26 bars back.
- Short — the mirror: price below the cloud, bearish TK cross, Chikou below price.
- Stop — the Kijun-sen or the far edge of the cloud.
The code
python · ichimoku.pydef midline(highs, lows, n):
return (max(highs[-n:]) + min(lows[-n:])) / 2
tenkan = midline(highs, lows, 9)
kijun = midline(highs, lows, 26)
span_a = (tenkan + kijun) / 2 # plotted 26 ahead
span_b = midline(highs, lows, 52) # plotted 26 ahead
cloud_top = max(span_a, span_b)
if closes[-1] > cloud_top and tenkan > kijun: signal = 'buy'
Where Ichimoku lags
Ichimoku's strength — demanding cloud position, a TK cross and Chikou confirmation — is also its weakness: by the time all three align, a big chunk of the move is gone, and in violent V-reversals the Chikou rule keeps you out entirely. It excels in clean, sustained trends and struggles in fast, choppy markets, the classic trend-following trade-off.
Sizing and risk
Use the Kijun-sen as a trailing stop and size from that distance with the position calculator. Ichimoku's many settings make it tempting to over-tune; keep the classic 9/26/52 and validate any change out-of-sample in the backtester rather than curve-fitting the cloud to last year's chart.
Frequently asked questions
What is the Ichimoku trading strategy?
Ichimoku is a self-contained trend system using five lines and a projected cloud (Kumo). The core strategy goes long when price is above the cloud with a bullish Tenkan/Kijun cross and Chikou confirmation, and short in the mirror condition.
What is the Ichimoku cloud (Kumo)?
The cloud is the shaded area between Senkou Span A and B, projected 26 periods into the future. Price above the cloud signals an uptrend, below signals a downtrend, and inside signals choppy no-trade conditions. The cloud's thickness shows the strength of future support or resistance.
What is a TK cross in Ichimoku?
A TK cross is when the Tenkan-sen (9-period conversion line) crosses the Kijun-sen (26-period base line). A bullish TK cross above the cloud is a long signal; a bearish one below the cloud is a short signal. It is Ichimoku's momentum trigger.
Does Ichimoku work well for bots?
Ichimoku codes cleanly into rules and works well as an automated trend system in sustained trends. Its weakness is lag: requiring cloud position, a TK cross and Chikou confirmation means it enters late and struggles in fast V-shaped reversals and choppy ranges.