Ready to go further
Next: test a rule honestly
The backtesting guide covers the steps and the traps, including reading a line at the wrong shift.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- The Ichimoku cloud is five lines built from midpoints of recent highs and lows: a conversion line, a base line, two lines that form the cloud, and a lagging line.
- Every line is an average of two numbers, the highest high and the lowest low over a window. The usual windows are 9, 26 and 52 bars.
- In the made-up path below, the last close of 105.22 sits below the cloud, whose edges are 106.38 and 109.57 (calculated by us on 28 Oct 2026, exact).
- The cloud is drawn 26 bars ahead of the data that built it, so it shows where old information sits. It reacts late to a turn.
- No setting of it avoids drawdown. A bot that follows the cloud still needs a test with costs, in more than one kind of market.
The five lines
Each line uses a midpoint: the highest high plus the lowest low over a window, divided by two. The standard windows are 9, 26 and 52 bars, which came from the trading week and month in the market where it was designed. They are conventions, and other windows are used in markets that trade at other times.
Base line (Kijun) = midpoint of the last 26 bars
Leading span A = (Tenkan + Kijun) / 2, drawn 26 bars ahead
Leading span B = midpoint of the last 52 bars, drawn 26 bars ahead
Lagging span (Chikou) = the close, drawn 26 bars back
The cloud is the area between leading span A and leading span B. When A is above B the cloud is usually coloured one way, and when A is below B the other. A thick cloud means the two spans are far apart, and a thin one means they are close.
A worked example
The made-up path has 110 bars: a slow rise of 0.1 a bar with a wave of plus and minus 9 on top, and each bar's high and low are 1 above and below its close. At the last bar the conversion line is 103.29 and the base line is 109.43. The cloud at this bar is made from the values 26 bars ago: span A is 109.57 and span B is 106.38. The close is 105.22, so it is below the cloud. The close from 26 bars back, where the lagging span is drawn, is 116.89, which is above today's close.
What traders read from it, and the traps
- Price against the cloud. Above is read as strength, below as weakness, inside as no trend. In the last 30 bars of the made-up path 19 closes were above, 1 inside and 10 below, in a path that rose overall.
- The conversion line against the base line. A cross of the two is read as a signal. Crosses of averages come late and flip often in a range.
- The lagging span. It compares today's close with the close 26 bars ago, which is a plain momentum check.
All of these are descriptions of the past. None says what comes next. The lines are also strongly related to each other, since they come from the same highs and lows, so using five of them is not five independent pieces of evidence.
How a bot misuses it
A bot that buys when the price is above the cloud and the lines agree is a trend follower. It tends to do best in a clean trend and worst in a range, where the price cuts through the cloud and the lines cross again and again. Each switch pays the spread and sometimes slippage. With many lines and windows there are many settings to tune, and tuning them to the past is overfitting. Also check how the platform draws the cloud: if a test reads a span at the wrong shift, it is using future information, which is look-ahead bias.
How to check a rule that uses it
Write the rule in words with every setting, test it in a range and in an uptrend and a downtrend, count the trades, use full costs and keep data back for one final test, as in backtesting. Look at the max drawdown.
What this page does not tell you
It does not say the cloud works. It shows the arithmetic of each line. The prices are made up and it is education, not a signal.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is the Ichimoku cloud?
An indicator with five lines made from the midpoints of recent highs and lows. The area between two of the lines, drawn 26 bars ahead, is the cloud.
How is the Ichimoku cloud calculated?
The conversion line is the midpoint of the last 9 bars and the base line of the last 26. Span A is their average and span B is the midpoint of the last 52, both drawn 26 bars ahead. The lagging span is the close drawn 26 bars back.
Why do the windows use 9, 26 and 52?
They are conventions from the market the indicator was designed for. Other markets use other windows, and any change is another setting that can be overfitted.
Does the cloud predict the price?
No. It is built from old highs and lows and is drawn ahead only as a display. It describes the past.
Can a bot trade the Ichimoku cloud?
It can, and a trend follower may do well in a clean trend. It needs a test with full costs in several kinds of market, and care that no line is read at the wrong shift.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education about a calculation. The prices are made up and it is not a signal.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss