Code Library / Ichimoku

Pine Script Ichimoku Cloud

Complete Ichimoku Cloud with all 5 lines and cloud fill.

Language: Pine Script · Category: Ichimoku · Tags: Ichimoku, cloud, Pine Script, TradingView, trend

Source code

//@version=5
indicator("Ichimoku",overlay=true)
t=(ta.highest(high,9)+ta.lowest(low,9))/2
k=(ta.highest(high,26)+ta.lowest(low,26))/2
sA=(t+k)/2; sB=(ta.highest(high,52)+ta.lowest(low,52))/2
plot(t,"Tenkan",color.blue); plot(k,"Kijun",color.red)
p1=plot(sA,"SA",color.green,offset=26)
p2=plot(sB,"SB",color.red,offset=26)
fill(p1,p2,color=sA>sB?color.new(color.green,90):color.new(color.red,90))
plot(close,"Chikou",color.green,offset=-26)

How to use this snippet

This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.

Related snippets