What is Ichimoku Cloud?
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.
Components of Ichimoku Cloud
The Ichimoku Cloud is composed of five lines, each with a specific calculation and interpretation:
- Tenkan-sen (Conversion Line): (Highest High + Lowest Low) / 2, calculated over the past 9 periods. It represents a short-term moving average, akin to a fast EMA.
- Kijun-sen (Base Line): (Highest High + Lowest Low) / 2, calculated over the past 26 periods. It represents a medium-term moving average, similar to a slower EMA.
- Senkou Span A (Leading Span A): (Tenkan-sen + Kijun-sen) / 2, plotted 26 periods ahead. It forms one boundary of the Cloud.
- Senkou Span B (Leading Span B): (Highest High + Lowest Low) / 2, calculated over the past 52 periods, plotted 26 periods ahead. It forms the other boundary of the Cloud.
- Chikou Span (Lagging Span): The current closing price, plotted 26 periods behind. It provides insight into price momentum relative to past price action.
The space between Senkou Span A and Senkou Span B is the Kumo (Cloud). The cloud changes color based on which leading span is higher, indicating bullish (green) or bearish (red) sentiment.
Basic Ichimoku Cloud Implementation in Pine Script
Pine Script v5 includes a built-in function `ta.ichimoku()` that simplifies the calculation of all Ichimoku components.
//@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") // Also for Senkou Spans
// Calculate Ichimoku components using the built-in function
// Returns: Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, Chikou Span
[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 between Senkou Span A and Senkou Span B, coloring based on cloud direction
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)
Practical Ichimoku Cloud Strategies
1. Kumo Breakout Strategy (Trend Identification)
One of the most fundamental Ichimoku strategies involves price breaking out of the Kumo (Cloud). This often signals a strong trend initiation or continuation.
- Bullish Kumo Breakout: Price moves and closes above the top of the Cloud. Confirmed by a bullish cloud (Senkou Span A above Senkou Span B).
- Bearish Kumo Breakout: Price moves and closes below the bottom of the Cloud. Confirmed by a bearish cloud (Senkou Span B above Senkou Span A).
//@version=5
strategy("Ichimoku Kumo Breakout Strategy", overlay=true)
// Inputs
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
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(conversionPeriod, basePeriod, displacement, laggingSpanOffset)
// Determine the cloud boundaries
kumoTop = math.max(senkouA[displacement], senkouB[displacement])
kumoBottom = math.min(senkouA[displacement], senkouB[displacement])
// Bullish breakout condition
longCondition = close > kumoTop and close[1] <= kumoTop[1] // Price closes above cloud top
longConfirmation = senkouA > senkouB // Cloud is bullish
// Bearish breakout condition
shortCondition = close < kumoBottom and close[1] >= kumoBottom[1] // Price closes below cloud bottom
shortConfirmation = senkouB > senkouA // Cloud is bearish
// Strategy entries
if (longCondition and longConfirmation)
strategy.entry("Long", strategy.long)
if (shortCondition and shortConfirmation)
strategy.entry("Short", strategy.short)
// Plot Ichimoku components (optional for strategy scripts but good for visualization)
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)
2. Tenkan-sen / Kijun-sen Crossover Strategy
Similar to traditional moving average crossovers, the cross between the Tenkan-sen and Kijun-sen provides momentum-based signals.
- Bullish Crossover: Tenkan-sen crosses above Kijun-sen.
- Bearish Crossover: Tenkan-sen crosses below Kijun-sen.
- Confirmation: For stronger signals, these crossovers should occur above/below the cloud, or be confirmed by the Chikou Span's position.
//@version=5
strategy("Ichimoku TK Crossover Strategy", overlay=true)
// Inputs
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
[tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(conversionPeriod, basePeriod, displacement, laggingSpanOffset)
// Plot Ichimoku components (optional)
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)
// Crossover conditions
longCondition = ta.crossover(tenkan, kijun)
shortCondition = ta.crossunder(tenkan, kijun)
// Optional: Add filter for cloud position (e.g., only take long if above cloud)
// kumoTop = math.max(senkouA[displacement], senkouB[displacement])
// kumoBottom = math.min(senkouA[displacement], senkouB[displacement])
// longCondition := longCondition and close > kumoTop
// Strategy entries
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
Optimizing Ichimoku Cloud Performance
Given its comprehensive nature, optimizing Ichimoku requires a holistic approach:
- Parameter Tuning: While (9, 26, 52) are standard, custom periods can be more effective for certain assets or timeframes. Some traders use (20, 60, 120) or (10, 30, 60).
- Multi-Timeframe Confluence: Confirm signals and trends across different timeframes (e.g., daily chart for overall trend, 4-hour chart for entries).
- Combine with Volume: High volume accompanying a cloud breakout or Tenkan/Kijun crossover can confirm the strength of the signal.
- Price Action & Candlesticks: Use candlestick patterns to confirm Ichimoku signals at key levels (e.g., a bullish engulfing pattern at the Kijun-sen or cloud support).
- Identify Ranging Markets: Ichimoku works best in trending markets. Use other indicators (like ADX) to confirm trend strength and avoid trading based on Ichimoku in sideways markets.
Common Ichimoku Cloud Pitfalls
- Complexity: The sheer number of lines can be overwhelming for beginners, leading to misinterpretation.
- Lagging Indicator: Similar to other trend-following tools, Ichimoku can lag price action, especially during sharp reversals. The cloud is plotted 26 periods into the future, and Chikou Span 26 periods back, which can make it seem anticipatory but it is still derived from past data.
- Whipsaws in Consolidation: In choppy or range-bound markets, the indicator can generate many false signals and the cloud may appear thin and flat, offering little guidance.
- Over-Reliance on One Signal: Relying on a single signal (e.g., just a Tenkan-Kijun crossover) without confirming with other Ichimoku components or price action is a common mistake.
Conclusion
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.
Enhance Your Trading
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.
Subscribe now @ $99/month