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

SettingDefaultRangeWhat it does
conversion91 to 500Conversion line (tenkan) candles.
base261 to 500Base line (kijun) candles.
span_b521 to 500Leading span B candles.
displacement260 to 500Candles the cloud is shifted forward.

What it gives

OutputWhat it is
Conversion lineConversion line (tenkan-sen).
Base lineBase line (kijun-sen).
Leading span ALeading span A at the current candle.
Leading span BLeading 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