Master this powerful multi-dimensional indicator in TradingView's Pine Script for comprehensive trend, momentum, and support/resistance analysis.
The Ichimoku Kinko Hyo, commonly known as the Ichimoku Cloud, is a comprehensive technical analysis indicator that provides multiple insights into price action on a single chart. Developed by Goichi Hosoda (pen name "Ichimoku Sanjin") in the late 1930s, it's a trend-following indicator that offers a unique multi-dimensional view of support and resistance levels, momentum, and trend direction over various timeframes.
Unlike other indicators that provide a single line or data point, Ichimoku consists of five lines, two of which form a "cloud" that helps traders visualize potential future support/resistance and trend strength.
The Ichimoku Cloud is composed of five lines, each with a specific calculation and interpretation:
//@version=5
indicator("My Ichimoku Cloud Indicator", overlay=true)
// Inputs for Ichimoku parameters
conversionPeriod = input.int(9, title="Tenkan-sen Periods")
basePeriod = input.int(26, title="Kijun-sen Periods")
laggingSpanOffset = input.int(26, title="Chikou Span Offset")
displacement = input.int(26, title="Cloud Displacement")
// Calculate Ichimoku components using the built-in function
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(conversionPeriod, basePeriod, displacement, laggingSpanOffset)
// Plot the Tenkan-sen (Conversion Line)
plot(tenkan, title="Tenkan-sen", color=color.blue, linewidth=1)
// Plot the Kijun-sen (Base Line)
plot(kijun, title="Kijun-sen", color=color.red, linewidth=1)
// Plot the Chikou Span (Lagging Span) - shifted back
plot(chikou, title="Chikou Span", color=color.purple, linewidth=1)
// Plot the Cloud (Kumo)
fill(senkouA, senkouB, color=senkouA > senkouB ? color.new(color.green, 90) : color.new(color.red, 90), title="Cloud Fill")
// Plot the Leading Spans
plot(senkouA, title="Senkou Span A", color=color.new(color.green, 50), linewidth=1, offset=displacement)
plot(senkouB, title="Senkou Span B", color=color.new(color.red, 50), linewidth=1, offset=displacement)
The most common settings for Ichimoku Cloud are (9, 26, 52). However, these can be adjusted for different asset classes or timeframes.
One of the most fundamental Ichimoku strategies involves price breaking out of the Kumo (Cloud). This often signals a strong trend initiation or continuation.
//@version=5
strategy("Ichimoku Kumo Breakout Strategy", overlay=true)
conversionPeriod = input.int(9, title="Tenkan-sen Periods")
basePeriod = input.int(26, title="Kijun-sen Periods")
laggingSpanOffset = input.int(26, title="Chikou Span Offset")
displacement = input.int(26, title="Cloud Displacement")
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(conversionPeriod, basePeriod, displacement, laggingSpanOffset)
kumoTop = math.max(senkouA[displacement], senkouB[displacement])
kumoBottom = math.min(senkouA[displacement], senkouB[displacement])
longCondition = close > kumoTop and close[1] <= kumoTop[1]
longConfirmation = senkouA > senkouB
shortCondition = close < kumoBottom and close[1] >= kumoBottom[1]
shortConfirmation = senkouB > senkouA
if (longCondition and longConfirmation)
strategy.entry("Long", strategy.long)
if (shortCondition and shortConfirmation)
strategy.entry("Short", strategy.short)
plot(tenkan, title="Tenkan-sen", color=color.blue)
plot(kijun, title="Kijun-sen", color=color.red)
plot(chikou, title="Chikou Span", color=color.purple)
fill(senkouA, senkouB, color=senkouA > senkouB ? color.new(color.green, 90) : color.new(color.red, 90))
plot(senkouA, title="Senkou Span A", color=color.new(color.green, 50), offset=displacement)
plot(senkouB, title="Senkou Span B", color=color.new(color.red, 50), offset=displacement)
Similar to traditional moving average crossovers, the cross between the Tenkan-sen and Kijun-sen provides momentum-based signals.
//@version=5
strategy("Ichimoku TK Crossover Strategy", overlay=true)
conversionPeriod = input.int(9, title="Tenkan-sen Periods")
basePeriod = input.int(26, title="Kijun-sen Periods")
laggingSpanOffset = input.int(26, title="Chikou Span Offset")
displacement = input.int(26, title="Cloud Displacement")
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(conversionPeriod, basePeriod, displacement, laggingSpanOffset)
plot(tenkan, title="Tenkan-sen", color=color.blue)
plot(kijun, title="Kijun-sen", color=color.red)
plot(chikou, title="Chikou Span", color=color.purple)
fill(senkouA, senkouB, color=senkouA > senkouB ? color.new(color.green, 90) : color.new(color.red, 90))
plot(senkouA, title="Senkou Span A", color=color.new(color.green, 50), offset=displacement)
plot(senkouB, title="Senkou Span B", color=color.new(color.red, 50), offset=displacement)
longCondition = ta.crossover(tenkan, kijun)
shortCondition = ta.crossunder(tenkan, kijun)
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
Given its comprehensive nature, optimizing Ichimoku requires a holistic approach:
Ichimoku is a complete trading system. Its power comes from combining the signals from all five lines and the cloud, not just one component in isolation.
The Ichimoku Cloud is a uniquely powerful and comprehensive technical indicator in Pine Script for TradingView. It provides a holistic view of trend direction, momentum, and dynamic support/resistance levels. While it may appear complex initially, mastering its five components and understanding how they interact can significantly enhance your market analysis. By thoughtfully integrating Ichimoku into your trading strategies and confirming its signals with other tools, you can leverage its full potential to navigate and profit from market trends.
Get a high-performance Pine Script analysis tool for actionable market insights, designed for traders on the move.
This strategy runs in live mode on TradingView, helping you identify potential opportunities.
Get Pine Script Strategy