Calculate the Ichimoku Cloud indicator for a given price series.

The Ichimoku Cloud, also known as the Ichimoku Kinko Hyo, is a versatile indicator that defines support and resistance, identifies trend direction, gauges momentum, and provides trading signals.

The formula is as follows:

\[\text{Conversion Line} = (\text{Highest High} + \text{Lowest Low}) / 2,\;\; \text{over conversion\_window periods}\] \[\text{Base Line} = (\text{Highest High} + \text{Lowest Low}) / 2,\;\; \text{over base\_window periods}\] \[\text{Leading Span} A = ((\text{Conversion Line} + \text{Base Line}) / 2),\;\; \text{shifted forward base\_window periods}\] \[\text{Leading Span} B = (\text{Highest High} + \text{Lowest Low}) / 2 \text{over} \text{lead\_span\_b\_window} \text{periods},\;\; \text{shifted forward base\_window periods}\]

Also known as: Ichimoku Kinko Hyo, cloud indicator. The default windows (9, 26, 52) are Goichi Hosoda’s original values, both leading spans are conventionally displaced forward by the base (Kijun-sen) period.

Ichimoku Cloud in Python

get_ichimoku_cloud is part of the Technicals module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_ichimoku_cloud as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT"])

toolkit.technicals.get_ichimoku_cloud().xs("AAPL", level=1, axis="columns")

Which returns:

Date Base Line Conversion Line Leading Span A Leading Span B
2026-06-18 302.39 302.39 307.225 286.8
2026-06-22 302.39 294.9 306.55 287.03
2026-06-23 302.39 294.9 302.59 287.295
2026-06-24 302.39 296.005 302.39 287.605
2026-06-25 295.575 288.085 302.39 289.335
2026-06-26 295.575 288.085 302.39 291.235
2026-06-29 295.575 288.085 302.39 291.235
2026-06-30 295.575 288.085 302.39 291.235
2026-07-01 295.575 288.085 302.39 291.235
2026-07-02 295.575 291.585 302.39 291.235

Parameters

get_ichimoku_cloud accepts the following parameters:

  • period (str, optional): The time period to consider for historical data. Can be “daily”, “weekly”, “quarterly”, or “yearly”. Defaults to “daily”.
  • conversion_window (int, optional): The number of periods to consider for the Conversion Line (Tenkan-sen) calculation. Defaults to 9.
  • base_window (int, optional): The number of periods to consider for the Base Line (Kijun-sen) calculation, also used as the forward displacement for both Leading Spans. Defaults to 26.
  • lead_span_b_window (int, optional): The number of periods to consider for the Lead Span B (Senkou Span B) calculation. Defaults to 52.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the indicator values. Defaults to False.
  • lag (int | list[int], optional): The lag to use for the growth calculation.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. Defaults to 1.
Share