# Coloured Ichimoku Cloud 7,22,44,22

191 0
Uses the classic 7,22,44,22 periods.
//Created By User George Stewart
//Last Update 01/03/2015
//new Updates include Cloud Color Change based on Trend.based on Trend
//Added ability to turn on/off Tenkan-Sen (7 Period), Kinjun-Sen (22 Period), Chinkou Span (Lagging Line), and "Cloud"
study(title="Coloured Ichimoku Cloud 7,22,44,22", shorttitle="Coloured Ichimoku Cloud", overlay=true)
turningPeriods = input(7, minval=1, title="Tenkan-Sen")
standardPeriods = input(22, minval=1, title="Kinjun-Sen")
leadingSpan2Periods = input(44, minval=1, title="Senkou Span B")
displacement = input(22, minval=1, title="-ChinkouSpan/+SenkouSpan A")
sts = input(true, title="Show Tenkan-Sen (7 Period)?")
sks = input(true, title="Show Kinjun-Sen (22 Period)?")
sll = input(true, title="Show Chinkou Span (Lagging Line)?")
sc = input(true, title="Show Cloud?")
cr1 = input(false, title="Show Crosses up/down Tenkan-Sen (7 Period) and Kinjun-Sen (22 Period?")

//Definitions for Tenkan-Sen (7 Period), Kinjun-Sen (22 Period), Chinkou Span (Lagging Line)
donchian(len) => avg(lowest(len), highest(len))
turning = donchian(turningPeriods)
standard = donchian(standardPeriods)

//Crosses up/down Tenkan-Sen (7 Period) and Kinjun-Sen (22 Period)
crossUpTenkanKinjun = turning[1] < standard[1] and turning > standard ? 1 : 0
crossDnTenkanKinjun = turning[1] > standard[1] and turning < standard ? 1 : 0
cupA = crossUpTenkanKinjun == 1 ? crossUpTenkanKinjun : 0
cdnB = crossDnTenkanKinjun == 1 ? crossDnTenkanKinjun : 0

//First Definition for Ability to Color Cloud based on Trend.
//Next 4 lines are code used as plots in order to Color Cloud based on Trend

//plots for 3 lines other than cloud.
plot(sts and turning ? turning : na, title = 'Tenkan-Sen (7 Period)', linewidth=2, color=red)
plot(sks and standard ? standard : na, title = 'Kinjun-Sen (22 Period)', linewidth=2, color=navy)
plot(sll and close ? close : na, title='Chinkou Span (Lagging Line)', linewidth=2, offset = -displacement, color=yellow)
//Cloud Lines Plot Statements - ***Regular Lines to Fill in Break in Gap
plot(sc and leadingSpan1 ? leadingSpan1 : na, title = 'Senkou Span A (22 Period) Cloud', style=line, linewidth=1, offset = displacement, color=col)
plot(sc and leadingSpan2 ? leadingSpan2 : na, title = 'Senkou Span B (44 Period) Cloud', style=line, linewidth=1, offset = displacement, color=col)
//Cloud Lines Plot Statements - ***linebr to create rules for change in Shading
p1 = plot(sc and span1plotU ? span1plotU  : na, title = 'Senkou Span A (22 Period) Above Span B Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
p2 = plot(sc and span2plotU ? span2plotU  : na, title = 'Senkou Span B (44 Period) Below Span A Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
p3 = plot(sc and span1plotD ? span1plotD  : na, title = 'Senkou Span A (22 Period) Below Span B Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
p4 = plot(sc and span2plotD ? span2plotD  : na, title = 'Senkou Span B (44 Period) Above Span A Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
//Fills that color cloud based on Trend.
fill(p1, p2, color=aqua, transp=70, title='Kumo (Cloud)')
fill(p3, p4, color=orange, transp=70, title='Kumo (Cloud)')
//Arrow Plots At Tenkan-Sen (7 Period) and Kinjun-Sen (22 Period)
plotarrow(cr1 and cupA ? cupA : na, title="CrossUp Tenkan Kinjun Entry Arrow", colorup=yellow, maxheight=90, minheight=50, transp=0)
plotarrow(cr1 and cdnB*-1 ? cdnB*-1 : na, title="CrossDn Tenkan Kinjun Entry Arrow", colordown=yellow, maxheight=90, minheight=50, transp=0)

EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter