Ichimoku Cloud: All Five Lines, and What 705 Real Crosses Returned
The ichimoku cloud looks like the most complicated overlay in technical analysis and is built from one repeated idea: the midpoint of the highest high and lowest low over a window. Three window lengths, one averaging step and two time shifts produce all five lines, cloud included. Vike computes the whole system as batch_ichimoku, part of our trading indicators engine.
Complicated-looking tools attract vague claims, so this page does the opposite of vague. The exact arithmetic first, including the two details almost every summary skips — what the lines actually average, and what happens to the displaced spans at the edge of the chart. Then 705 real tenkan/kijun crosses, scored against forward bars and against their own break-even.
What the ichimoku cloud is
Everything on the chart derives from one function: take the highest high and the lowest low over the last N bars and split the difference. That midpoint is not a moving average — a single spike at either extreme pins it for the whole window, and quiet drift inside an old range moves it not at all.
Run that midpoint at three speeds — 9 bars, 26, 52 — and you have the raw material. The tenkan (9) tracks the recent swing, the kijun (26) the intermediate one, and the 52-bar midpoint becomes one wall of the cloud. Price above the cloud reads as uptrend, below as downtrend, inside as undecided. The NEAR chart below shows the full system drawn by our engine on real daily bars, cloud shading and all.
The five ichimoku lines our engine computes
batch_ichimoku computes: three window midpoints, one average, two time shifts. Warm-up follows the windows — tenkan exists from bar 8, kijun from 25, senkou A from 51 and senkou B from bar 77.Here is the entire computation, as the crate runs it.
How Vike computes it.batch_ichimokubuildsdonchian_mid(p)[i] = (max(high, p bars) + min(low, p bars)) / 2for periods 9, 26 and 52. Tenkan is the 9-midpoint, kijun the 26. Senkou A is(tenkan + kijun) / 2shifted forward by 26 bars; senkou B is the 52-midpoint, shifted forward the same 26; the cloud is the region between them. Chikou is the close shifted 26 bars backward —chikou[i] = close[i + 26]. All five outputs stay aligned to the input, one value per bar.
Warm-up follows straight from the windows. Tenkan first exists on bar 8 and kijun on bar 25; senkou A needs both plus the shift, so it lands on bar 51, and senkou B — a 52-bar window pushed 26 forward — first appears on bar 77. Nothing partial is emitted before those points.
I ported the rule from the crate source and checked it against the Python implementation it was itself ported from, across fourteen symbols and a thousand daily bars each: 67,382 compared values over all five lines, largest absolute difference 0.000e+00, warm-up and edge masks matching bar for bar. The scores further down are measurements of exactly this code.
The displacement, and the edge of the chart
Both spans are computed today and plotted 26 bars into the future — that is the cloud ahead of price on every ichimoku chart, and it is also where implementations quietly differ.
Our arrays keep the length of the input. A span value whose target lands past the last bar is dropped, not stored: the crate never draws cloud beyond the newest close, and the 26 most recent span values it computes simply wait, reappearing one at a time as new bars arrive to receive them. Chikou mirrors the same edge in reverse — its final 26 slots are empty because the closes that would fill them have not happened yet.
That displacement also explains a warning in our own registry: ichimoku is flagged batch-only, because a value plotted at bar i can involve prices from bar i + 26. Nothing about that leaks the future into a live signal — at any moment you only ever see spans computed from finished bars — but it does mean naive bar-by-bar streaming reconstructions of chikou are wrong by construction, and I have seen backtests read the chikou column as if it were knowable at its plotted position. At position i, that value is the close of a bar 26 steps ahead.
How to trade the tenkan kijun cross — scored
The classic entry is the TK cross: buy when the tenkan crosses above the kijun, sell when it crosses below.
Across 13,482 daily bars where both lines existed, that fired 705 times — one signal every 19.1 bars. Each one was resolved first-touch over the next ten bars against a +6% target and an 8% stop, a bar touching both scored as a loss; the identical bracket to our MACD page, so the numbers compare directly. Bullish crosses: 349, resolving 164 wins to 136 losses, a 54.7% hit rate. Bearish: 356, resolving 190 to 128, or 59.7%.
Risking eight to make six needs 57.1% just to break even before fees. So the long side of this signal, unfiltered, lost money on the sample — and the short side cleared its bar with real room. Publishing the losing half matters more than the winning half: a cross is a description of two midpoints, and nothing in it knows which regime you are in.
All four winning examples on this page are real detections — and when I quote a hit rate anywhere, its break-even now goes next to it.
Does the cloud filter help? Measured
Every ichimoku tutorial adds the same refinement: only take bullish crosses above the cloud and bearish crosses below it, so the trade goes with the established trend. When I first ran the filter I expected it to rescue the long side. It did not.
Requiring the signal bar's close above both spans cut the bullish sample from 349 to 107 and moved the hit rate from 54.7% to 56.2% — an improvement that still sits under the 57.1% break-even. The bearish filter was mildly harmful: 174 below-cloud crosses resolved at 58.9%, against 59.7% unfiltered. And the filter is expensive in signals: of 671 crosses where the cloud existed, 358 happened below it, 211 above, 102 inside, so the "textbook" long setup — a bullish cross above the cloud — is a minority event in this data.
That result surprised me enough to re-run the scan before believing it. The honest summary: on these 14 symbols and this bracket, cloud position described the trend without improving the cross.
Where the ichimoku cloud fails
Both failure charts below are real signals our detector produced this month.
ADA's cross was the textbook setup — bullish, above the cloud — and price fell 8.7% to the stop anyway. The LINK cross was bearish inside the cloud and rose 9.0% instead. Neither is an outlier: at a 54.7% hit rate, the long signal fails almost every second time, which is roughly a coin toss with better marketing.
Structural lag compounds this. Every input is a window midpoint, so after a strong leg the kijun and both spans sit at levels set by extremes up to 52 bars old — the same lateness every summary-based tool carries, from the golden cross to a smoothed chart type like heikin ashi. And in a range, tenkan and kijun braid around each other producing crosses at the pace of noise; one per 19 bars on average, far more often exactly where they are least reliable.
Frequently asked questions
What are the best ichimoku settings? The measured defaults here are 9/26/52, inherited from the six-day trading week the system was designed around. Changing them is legitimate but resets every number on this page — shorter windows multiply crosses, and each extra cross arrives with the same sub-break-even long-side economics until proven otherwise.
Is the ichimoku cloud predictive because it is drawn forward? No. The displacement moves where a finished calculation is plotted, not what it knows — senkou A at today's position was computed 26 bars ago from bars that had already closed. The forward cloud is a projection of the past into the future's x-coordinates.
Why is chikou missing on the last 26 bars?
Because chikou[i] is the close 26 bars ahead of position i, and for recent positions that close does not exist yet. Our engine leaves those slots empty rather than inventing values.
Is a TK cross better than a MACD cross? On the same fourteen symbols and the same bracket, the MACD crossover resolved 55.2% bullish and 64.9% bearish against this signal's 54.7% and 59.7% — both tools short-side-heavy, both long sides near or below break-even. Neither deserves to be traded without price confirmation from something like RSI context or a raw-candle signal.
This is educational material, not financial advice. Every statistic above was measured on past bars with one fixed bracket, past behavior generalizes poorly, and trading carries real risk of loss — size positions so that being wrong stays affordable.