Ichimoku
The Ichimoku cloud: midpoints of recent ranges that show trend, support and resistance.
Ichimoku without lookahead; every window includes the current candle. conversion (tenkan) = (highest high + lowest low) ÷ 2 over conversion candles; base (kijun) = the same over base; span_a and span_b are the cloud AT the current candle: span_a = (conversion + base) ÷ 2 and span_b = the midpoint over span_b candles, both computed displacement − 1 candles ago (TradingView's plot offset: the displacement counts the current candle). The lagging span (today's close drawn in the past) is close compared with an offset. Ready at span_b + displacement − 1 candles.
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| conversion | 9 | 1 to 500 | Conversion line (tenkan) candles. |
| base | 26 | 1 to 500 | Base line (kijun) candles. |
| span_b | 52 | 1 to 500 | Leading span B candles. |
| displacement | 26 | 0 to 500 | Candles the cloud is shifted forward. |
What it gives
| Output | What it is |
|---|---|
| Conversion line | Conversion line (tenkan-sen). |
| Base line | Base line (kijun-sen). |
| Leading span A | Leading span A at the current candle. |
| Leading span B | Leading span B at the current candle. |
What it reads
It reads the whole candle (open, high, low, close and volume).
Warm-up
With its default settings, Ichimoku needs 104 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses Ichimoku with its default settings