Indicator · Pine Script v6 · On the chart

Ichimoku Cloud

by AkashSasikumar47

The Ichimoku Cloud indicator plots five lines: Conversion Line, Base Line, Lagging Span, Leading Span A, and Leading Span B, forming a cloud on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code24
Settings4inputs
LicenceMIT
Last update2 weeks ago10 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

24 lines of Pine Script v6 from indicators/ichimoku-cloud.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

ichimoku-cloud.pine
//@version=6
indicator("Ichimoku Cloud", "ICHI", overlay = true)

conversionLength = input.int(9, "Conversion Line Length", minval = 1)
baseLength = input.int(26, "Base Line Length", minval = 1)
spanBLength = input.int(52, "Leading Span B Length", minval = 1)
displacement = input.int(26, "Lagging Span", minval = 1)

donchian(length) =>
    math.avg(ta.lowest(length), ta.highest(length))

conversionLine = donchian(conversionLength)
baseLine = donchian(baseLength)
spanA = math.avg(conversionLine, baseLine)
spanB = donchian(spanBLength)

plot(conversionLine, "Conversion Line", #2962FF)
plot(baseLine, "Base Line", #B71C1C)
plot(close, "Lagging Span", #43A047, offset = -displacement + 1)
spanAPlot = plot(spanA, "Leading Span A", #A5D6A7, offset = displacement - 1)
spanBPlot = plot(spanB, "Leading Span B", #EF9A9A, offset = displacement - 1)
plot(math.max(spanA, spanB), "Kumo Cloud Upper Line", offset = displacement - 1, display = display.none)
plot(math.min(spanA, spanB), "Kumo Cloud Lower Line", offset = displacement - 1, display = display.none)
fill(spanAPlot, spanBPlot, spanA > spanB ? color.rgb(67, 160, 71, 90) : color.rgb(244, 67, 54, 90))

Overview

Ichimoku Cloud shows trend and momentum by position relative to the cloud: above green is bullish, below red is bearish, and inside undecided. The cloud acts as dynamic support and resistance. Settings control line lengths and displacement for lagging lead. It is based on standard Ichimoku calculation.

Details

Published by

AkashSasikumar47 on GitHub

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

pine-scriptpinescript-v6technical-analysistrading-indicatorstradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Conversion Line Lengthint9conversionLength
Base Line Lengthint26baseLength
Leading Span B Lengthint52spanBLength
Lagging Spanint26displacement
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

257 stars

This indicator analyzes short-term price action on index futures and options charts by applying Rational Quadratic kernel smoothing to detect sideways consolidation ranges and potential breakouts. It processes pivot highs and lows over customizable loopback pe

Indicator v5 Support & resistanceTrend Repaints
Updated 7 weeks ago · None stated GitHub repository of SPX 30M - Trading Chart

Ichimoku Cloud

by harryguiacorn
220 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud

MA Envelope (MAE)

by mihakralj
99 stars

The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p

Indicator v6 Moving averagesSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MA Envelope (MAE)
56 stars

This indicator calculates an Exponential Moving Average and a Zero-Lag Moving Average to identify market trends on the price chart. It plots both moving averages and fills the space between them with color to highlight trend direction. Upon a crossover or cros

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of No-Lag MA Trend Levels

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers