CM Enhanced Ichimoku Cloud V5

Ichimoku Cloud Indicator With Cloud Shading Based On Trend!!!

I’m releasing this Indicator b/c of the New Feature that Allows Coding The Fill of The Cloud To Change Colors Based On Trend. However, I will be releasing a Much More Advanced Version Soon!!!

Current Features - Via Inputs Tab:

- Ability to Turn On/Off Every Plot Individually Via Check Box
- Ability To Turn On/Off Tenkan and Kinjun Crosses (Arrows)

***Features Coming Soon - All Will Have Capability to Turn On/Off:

- Bar Color Change when Entering The Cloud
- Filtered Tenkan and Kinjun Crosses To Plot Only With Trend, only Counter Trend, Or All Crosses
- Plot Arrows When Price Exits The Cloud.
- Plot Arrows When Lagging Line Crosses The Cloud Confirmed, or Not Confirmed by Price.
- Plus More!!!
- Basically Ability To Set Alerts Based On Any Condition!!!

Remove from Favorite Scripts Add to Favorite Scripts
//Created By User ChrisMoody
//Last Update 10/20/2014
//new Updates include Cloud Color Change based on Trend.based on Trend
//Added ability to turn on/off Tenkan-Sen (9 Period), Kinjun-Sen (26 Period), Chinkou Span (Lagging Line), and "Cloud"
//Correct Plot Names for Alerts
study(title="CM_Enhanced_Ichimoku Cloud-V5", shorttitle="CM_Enhanced_Ichimoku-V5", overlay=true)
turningPeriods = input(9, minval=1, title="Tenkan-Sen")
standardPeriods = input(26, minval=1, title="Kinjun-Sen")
leadingSpan2Periods = input(52, minval=1, title="Senkou Span B")
displacement = input(26, minval=1, title="-ChinkouSpan/+SenkouSpan A")
sts = input(true, title="Show Tenkan-Sen (9 Period)?")
sks = input(true, title="Show Kinjun-Sen (26 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 (9 Period) and Kinjun-Sen (26 Period?")

//Definitions for Tenkan-Sen (9 Period), Kinjun-Sen (26 Period), Chinkou Span (Lagging Line)
donchian(len) => avg(lowest(len), highest(len))
turning = donchian(turningPeriods)
standard = donchian(standardPeriods)
leadingSpan1 = avg(turning, standard)
leadingSpan2 = donchian(leadingSpan2Periods)

//Crosses up/down Tenkan-Sen (9 Period) and Kinjun-Sen (26 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.
leadingSpan1Above = leadingSpan1 >= leadingSpan2 ? 1 : na
leadingSpan2Below = leadingSpan1 <= leadingSpan2 ? 1 : na
//Next 4 lines are code used as plots in order to Color Cloud based on Trend
span1plotU = leadingSpan1Above ? leadingSpan1 : na
span2plotU = leadingSpan1Above ? leadingSpan2 : na

span1plotD = leadingSpan2Below ? leadingSpan1 : na
span2plotD = leadingSpan2Below ? leadingSpan2 : na

col = leadingSpan1 >= leadingSpan2 ? lime : red

//plots for 3 lines other than cloud.
plot(sts and turning ? turning : na, title = 'Tenkan-Sen (9 Period)', linewidth=4, color=lime)
plot(sks and standard ? standard : na, title = 'Kinjun-Sen (26 Period)', linewidth=4, color=fuchsia)
plot(sll and close ? close : na, title='Chinkou Span (Lagging Line)', linewidth=4, offset = -displacement, color=aqua)
//Cloud Lines Plot Statements - ***Regular Lines to Fill in Break in Gap
plot(sc and leadingSpan1 ? leadingSpan1 : na, title = 'Senkou Span A (26 Period) Cloud', style=line, linewidth=5, offset = displacement, color=col)
plot(sc and leadingSpan2 ? leadingSpan2 : na, title = 'Senkou Span B (52 Period) Cloud', style=line, linewidth=5, 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 (26 Period) Above Span B Cloud', style=linebr, linewidth=6, offset = displacement, color=col)
p2 = plot(sc and span2plotU ? span2plotU  : na, title = 'Senkou Span B (52 Period) Below Span A Cloud', style=linebr, linewidth=6, offset = displacement, color=col)
p3 = plot(sc and span1plotD ? span1plotD  : na, title = 'Senkou Span A (26 Period) Below Span B Cloud', style=linebr, linewidth=6, offset = displacement, color=col)
p4 = plot(sc and span2plotD ? span2plotD  : na, title = 'Senkou Span B (52 Period) Above Span A Cloud', style=linebr, linewidth=6, offset = displacement, color=col)
//Fills that color cloud based on Trend.
fill(p1, p2, color=lime, transp=70, title='Kumo (Cloud)')
fill(p3, p4, color=red, transp=70, title='Kumo (Cloud)')
//Arrow Plots At Tenkan-Sen (9 Period) and Kinjun-Sen (26 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)
Never learned how to use this...I'll check it out, looks cool!
Thanks Chris, going to try it out now.
No Problem
Awesome. Ichimoku System is the best I have seen in my trading years. Thanks for work with it
Is it possible to change Chinkou Span (lagging) when it is above or below price?
The Chinkou Span has not code...ti's just current price displaced 26 bars back. So it always equals current price. Many people use it as follows. If Lagging line crosses through Cloud (The Cloud - 26 bars) before price...then price has a higher probability of crossing through cloud. If price crosses through cloud and lagging line hasn't...many people don't consider it a start of a new trend UNTIL Lagging Line ALSO crosses through Cloud.
Chris just had another look up close and was wondering the following:
Can Kumo be with less garish!! Was thinking muted colours but as a pattern instead of block luminous colour!! (I assume I can change this in styles)
The outlines could be thinner, way thinner!! (As above)
The crosses are great but can the be at the foot of the screen as they get in the way a bit! ????

If you went for the colours for impact you win but they dont half hurt your eyes!!

God I sound like a right fussy git, sorry mate, but have to say tis is great work and thank you as it is the best Ive seen out there!!
You can change the line thickness, plot style, and Colors of any indicator on TradingView ...It's a built in ability. However the programmer sets it up does not matter.
+1 Reply
IvanLabrie PRO ChrisMoody
Yup, you always goes for the flashy defaults however :D Thanks for the code and the tips, I'll do some reading on the subject and try this one out.
IvanLabrie PRO IvanLabrie
Seems like this is a solid system, I'll play around with your indicator, thanks Chris.
Hi Chris, any chance of having the ability to add in price target determined from consolidation patterns (N Waves)?
What are N Waves and what do they have to do with Ichimoku? Whatever the formula for N Waves is currently we can't plot the Lines that would plot the N waves...therefore I can't verify it's accuracy. Plotting price targets will come when we have ability to program Strategies. Creating code that plots lines on the chart will be coming in the future
+1 Reply
Chris, is it possible to not plot the last bar's signals until it's closed? I mean, only plot the indicators up to the last closed bar. it's useless to have a not confirmed value and distracting in my humble opinion. this idea originally came from Tim West by the way (you and him ate amongst the very best people around TV) thanks again for all the great things you share.
have a nice Sunday!
+1 Reply
ChrisMoody PRO IvanLabrie
Sorry...I missed your question a while back...yes this is easy to do so. Typically on any platform the settings for alerts/Entry signals are set on the close...However, charting platforms see the close as the current price. (Unless when we build in Alerts Function there is an option for IntraBar...or Close of Bar which is common).

Currently it is a simple fix. All you have to do is whatever the Signal is based off of....change the criteria and add a ...which means previous bar...therefore the second the next bar opens the signal will form just like it would if you had the option to choose "On Bar Close".

Example....Here is the code from above that Signals the Arrows for the crosses.
//Crosses up/down Tenkan-Sen (9 Period) and Kinjun-Sen (26 Period)
crossUpTenkanKinjun = turning < standard and turning > standard ? 1 : 0
crossDnTenkanKinjun = turning > standard and turning < standard ? 1 : 0

So all you would do to make On Bar Close be true is to adjust the code to this:
//Crosses up/down Tenkan-Sen (9 Period) and Kinjun-Sen (26 Period)
crossUpTenkanKinjun = turning < standard and turning > standard ? 1 : 0
crossDnTenkanKinjun = turning > standard and turning < standard ? 1 : 0
IvanLabrie PRO ChrisMoody
Not following you..."change the criteria and add a ..."???
'...' means previous bar?
Maybe this can apply to the average price per bar thing I wanted to code.

Can you give me an example? Not seeing '...' in your example. Thanks.
ChrisMoody PRO IvanLabrie
Sorry...There is a glitch in the system where when you post code here and you use the Square Brackets with a number in between it makes the code your plotting turn out differently.

Find the Code that has this header:
//Crosses up/down Tenkan-Sen (9 Period) and Kinjun-Sen (26 Period)

The next TWO lines have code and where I'm putting "1" you would use the Square Bracket and that number.
crossUpTenkanKinjun = turning"1" < standard"1" and turning > standard ? 1 : 0
crossDnTenkanKinjun = turning"1" > standard"1" and turning < standard ? 1 : 0

That is what code looks like in original script ...replacing the paranthesis with a Square Bracket...
Here is what new code would look like.

crossUpTenkanKinjun = turning"2" < standard"2" and turning"1" > standard"1" ? 1 : 0
crossDnTenkanKinjun = turning"2" > standard"2" and turning"1" < standard"1" ? 1 : 0
ChrisMoody PRO ChrisMoody
Just wanted to make sure that would go thru....

So alll we did was take the first turning and standard on the first two lines and replace the 1 with a 2....and on the last half of the statement we took the turning and standard and added in a square bracket with a 1
ChrisMoody PRO ChrisMoody
Just noticed the syntax wasn't accepted again...I'll create a short video showing this to willl take a little while...

I'll post link when it is finished
N Waves (as well as I, V, Y and P) are part of the three princples of analysis for the ichimoku cloud....... Wave Principle, Price Target and Timespan Principle !!
I read Nicole Elliot're right.
Didn't quite get the way they pick the 'waves', seemed quite subjective to me. More like price swings, and measure time cycles to get a price and time target.
Do you have any actual application or example you can provide? I've come to like ichimoku a lot, and am actively using it to filter trades that my methodology picks. :)
Hi Ivan, I did actually use the principle of my recent (last couple of days) Ichimoku for the EURUSD
+1 Reply
Ivan just checked and it was my most recent post / idea put up 2 days ago. The explanation underneath the chart should clarify but I will check back in a little while if you have any questions feel free to post on the chart. As it happens I gave 2 choices on the chart but I was sure at the time it would retrace which is what we are seeing today I think
+1 Reply
I took a combination of ichimoku and stuff I learnt from Tim West go short on the kijun/tenkan cross...all the other signal were bearish as well, and came after a flat period, so, a nice breakout.
0 drawdown :p
IvanLabrie PRO IvanLabrie
It would be absolutely great to be able to set up a combination of ichimoku signals to trigger email alerts here, don't you think?
Its possible..! =)
Chris, one thing I did wnat to flag is that the arros showing crossovers dont always show and on some charts dont show at all, any thoughts?? (The box is ticked btw!!_)
Sorry Scott...I missed the alert you had left a comment. The way the arrows currently plot we can't set a set arrow size...wo they adjust with the width of the if you have the candles close on the chart theoretically they are just can't see them...

It's an item that needs to be adjusted by the developers....However in the more advanced version I will make a background highlight and other plot types available to use...which will always show up...
Greetings Chris. I am still learning the Ichimoku and more and more gravitating towards that system. Your enhancements, proposed and already incorporated are merit worthy. Have you released the latest version (after v5) ? Look forward to it.
No...I'm way behind on requested codes...I'll get on it.
papapai ChrisMoody
Thanks Chris.
Please add a comment… Positive feedback and constructive criticism are important to authors and the community.
Thanks Again
Hi Chris, another post of yours that I commented on pointed me here. Thanks for the work you do. QUESTION: does the above code incorporate the changes noted in discussion below or do those changes need to be individually reproduced. Thanks Again!
ChrisMoody PRO ghettocounselor
Which features are you specifically talking about...I'm gong to work on this code soon.....but if they are suggestions then this is the latest version I have probably not
Hello Chris, nice work.
One feature I'm looking for is the ability to draw in the same chart two or more Ichimoku (for exemple 15m, 4H & 1D). That would be a great addition for me!
Maybe in option's tab an entry for this param with default on curent timeframe? Just an idea...
Thank you for your work.
ChrisMoody PRO virgotopia
That would be tough...but should be doable...nice idea and a good challenge for me.
way to go, man! ichimoku is where trading meets art. one day f my favorites
If you like Ichimoku I can't recommend enough Chris Capre's course at ... Chris is the only known American or for that matter anyone outside of Japan that has copies of the original books by the inventor of the Ichimoku Cloud. Chris Introduces the Advanced concepts most people have never heard of like Wave Theory.
d.jay.h ChrisMoody
Thank you very much, Chris. Much appreciated!
d.jay.h d.jay.h
*one of my favorites (predictive text)
Thank you for this amazing indicator! When will you release v6 with more alert options? :)
Thanks so much Chris. This version is a lot better than the TV version
Hi, it would be really great if you could code the buy signals to meet these conditions:
Long signal: Above the cloud, above kijun-sen and chiku-span above price.
Short signal: Below cloud, below kijun-sen and chiku-span below price.

Really appreciate your work man! Already using your Ichimoku indicator and are loving it :)
Hi Christ, these plot arrows once worked but not don't seem to show up, I wonder why?
v33_r v33_r
Chris* ;)
v33_r v33_r
Just to clarify, not sure why we can't edit our replies, the plot arrow indicators had shown up before but now—even after re-entering the code— do not.
i have the same issue
Thank you for this wondeful cloud..!!! =) Would love to have 2 more Kinjun-Sen (50, 100) implemented.. Is it possible..?!
albert.callisto CRYPTOBANGer
CM_Enhanced_Ichimoku Cloud-V5.1
Is it possible to get an MTF (Multi Time Frame) version of this indicator? For example, how would a 4H ichimoku look on a 15 min chart? Thanks
hello i Never learned how to use this? could someone help me pls?
ChrisMoody PRO shervin.binary
There are entire books written on just this system. I recommend running a search on youtube for Chris Capre of and Ichimoku Cloud. Note...Chris will have a lot of videos on Price Action which are great...But see if you can find one on Ichimoku cloud. He is the Premier Expert in the world in my opinion.

Here are a few:

Short Video:

More in depth video:

That's not all of them..but it's a start.
+1 Reply
" I will be releasing a Much More Advanced Version Soon!!!"
Have you done it?
Please post the link...
ChrisMoody PRO MarylinMulata
See comment below
Hey Chris lovely indicator! Thanks!
Have you maybe progressed with this? :)
ChrisMoody PRO Arabafenice
Unfortunately No....I've been gone for a little over a year working on a major coding project and I'm just getting back. It's on my list but no ETA right now.
Chris; could you make an update or create a line of code, so the chikou changes color once crossed above or below the cloud, with green and red? Thanks.
Hi CM! What would be the code to add an Alert ability?
chartsurfer chartsurfer
*For a Cloud break? Like "if the candle closes below the cloud, then send alert" .... This would change my life. Thanks I know you're a busy man...
Hi Chris,

The crossover arrows don't seem to plot
I have the tick box checked but still nothing.

Any ideas?

Hi Chris,

Could code a indi showing persistent lines of each top and Bottom level of each candle ?
with following parameters :
- From : Date to Date
- Time frame : Year, Month, Week, Day
- "Top" line : Red "Bottom" level : Green

you can email me

Best regards
How about ichimoku with time analysis
Hello, this indicator is for any type of asset, such as Stocks, forex?
Is it for any time graphic?
Do you already have a newer version?
thanks for this looks great. but me being stupid what should the chart time interval be set to, as it seems to be different depending on what interval i select
United States
United Kingdom
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out