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}\]

Price above the cloud is read as an uptrend and below it as a downtrend, with the cloud itself as support or resistance; a thick cloud is stronger support than a thin one. The leading spans are shifted forward by the base window, so the cloud value shown on a date was calculated base_window periods (26 by default) earlier from the data then available. The method returns the Conversion and Base Lines and the two Leading Spans but not the Lagging Span (the close shifted back), which would report a future close on each date.

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 or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_ichimoku_cloud as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^N225"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_ichimoku_cloud().xs("^N225", level=1, axis="columns").tail(5)

Or, after setting up the Finance Toolkit MCP, ask:

What did the Ichimoku cloud of the Nikkei 225 look like from 25 to 31 December 2025?

Which returns:

Date Base Line Conversion Line Leading Span A Leading Span B
2025-12-25 49808.9 49640.4 49824 48044.8
2025-12-26 49808.9 49792.8 49969.9 48072.9
2025-12-29 49814.3 49792.8 49969.9 48253.7
2025-12-30 49819.8 49792.8 50111.6 48497.3
2025-12-31 nan nan 50111.6 48497.3

Parameters

get_ichimoku_cloud accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”."Close"
conversion_windowintThe number of periods to consider for the Conversion Line (Tenkan-sen) calculation. Defaults to 9.10
base_windowintThe 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.30
lead_span_b_windowintThe number of periods to consider for the Lead Span B (Senkou Span B) calculation. Defaults to 52.60
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the indicator values. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share