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.

On this page
  1. The five lines
  2. The Kumo cloud
  3. The trade rules
  4. The code
  5. Where it lags
  6. Sizing & risk
  7. FAQ

The five lines, demystified

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.

Kumo cloud price clears cloud = long
A long sets up when price breaks and holds above the cloud with the fast line above the slow.

The trade rules

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

Confirmation costs you the first move

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.

Not financial advice. This content is educational. Automated and algorithmic trading carries a real risk of financial loss. Never trade money you cannot afford to lose. Review the SEC investor.gov and CFTC resources before trading.

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.

MB

Mustafa Bilgic

Algorithmic trading practitioner · Founder, AITradingBot.us

Mustafa builds and backtests automated trading systems and writes about them without the hype. Every tool on this site is free and runs entirely in your browser.