Ichimoku Timeframe 3.0

Ichimoku Cloud with
- Tenkan/Kijun Alerts and
- Kumo Breakout Alerts
Remove from Favorite Scripts Add to Favorite Scripts
//Created by @TraderR0BERT, NETWORTHIE.COM, last updated 03/28/2016
//Ichimoku Cloud Indicator
//Resolution input option for higher/lower time frames
//Alerts for common ichimoku trading signals

study(title="Ichimoku Timeframe 3.0", shorttitle="Ichimoku TF 3.0", overlay=true)

Ten = input(18, minval=1, title="Tenkan")
Kij = input(52, minval=1, title="Kijun")
LeadSpan = input(104, minval=1, title="Senkou B")
Displace = input(52, minval=1, title="Senkou A")
SpanOffset = input(52, minval=1, title="Span Offset")

timeframe = input(title="Timeframe", type=resolution, defval="60")
sts = input(false, title="Show Tenkan")
sks = input(false, title="Show Kijun")
ssa = input(true, title="Show Span A")
ssb = input(true, title="Show Span B")

source = close

//Script for Ichimoku Indicator
donchian(len) => avg(lowest(len), highest(len))
TS = donchian(Ten)
KS = donchian(Kij)
SpanA = avg(TS, KS)
SpanB = donchian(LeadSpan)
SpanAA = avg(TS, KS)[SpanOffset]
SpanBB = donchian(LeadSpan)[SpanOffset]

//Script for Timeframe Optionality
TSTF = security(tickerid, timeframe, TS)
KSTF = security(tickerid, timeframe, KS)

//plot for Tenkan and Kijun (Current Timeframe)
p1= plot(sts and TS ? TS : na, title="Tenkan", linewidth = 2, color = gray)
p2 = plot(sks and KS ? KS : na, title="Kijun", linewidth = 2, color = black)
p3 = plot(ssa and SpanA ? SpanA : na, title="SpanA", linewidth=2, offset=Displace, color=green)
p4 = plot(ssb and SpanB ? SpanB : na, title="SpanB", linewidth=2, offset=Displace, color=red)
p5 = plot(close, title="Chikou", linewidth = 2, offset=-Displace, color = orange)

//plot for Tenkan and Kijun (Timeframe Optionality)
p6 = plot(sts and TSTF ? TSTF : na, title="Tenkan TF", linewidth = 3, color = gray)
p7 = plot(sks and KSTF ? KSTF : na, title="Kijun TF", linewidth=3, color = black)

fill(p3, p4, color = gray, transp = 70, title="Kumo Cloud")

//Crosses Tenkan and Kijun (Arrows)
crossUpTSKS = TS[1] < KS[1] and TS > KS ? 1 : 0
crossDnTSKS = TS[1] > KS[1] and TS < KS ? 1 : 0
cupA = crossUpTSKS == 1 ? crossUpTSKS : 0
cdnA = crossDnTSKS == 1 ? crossDnTSKS : 0

//Plots Tenkan and Kijun Cross
plotarrow(cupA, title="CrossUp Tenkan Kinjun", colorup=green, maxheight=90, minheight=50, transp=0)
plotarrow(cdnA*-1, title="CrossDn Tenkan Kinjun", colordown=red, maxheight=90, minheight=50, transp=0)

//TS & KS Cross Alerts
TSKS_Cross = cross(TS, KS)
TSKS_Cross_TF = cross(TSTF, KSTF)
alertcondition(TSKS_Cross, title="Tenkan Kijun Cross", message="TS & KS Crossing")
alertcondition(TSKS_Cross_TF, title="Tenkan Kijun TF Cross", message="TS & KS TF Crossing")

//Kumo Breakout (Long)
SpanA_Top = SpanAA > SpanBB ? 1 : 0
SpanB_Top = SpanBB > SpanAA ? 1 : 0

LongSpanA = SpanAA > SpanBB and source[1] < SpanAA[1] and source > SpanAA ? 1 : 0
LongSpanB = SpanBB > SpanAA and source[1] < SpanBB[1] and source > SpanBB ? 1 : 0
cupB = LongSpanA == 1 ? LongSpanA : 0
cdnB = LongSpanB == 1 ? LongSpanB : 0

//Kumo Breakout (Long)
plotarrow(cupB, title="Kumo Breakout A-Long", colorup=green, maxheight=90)
plotarrow(cdnB, title="Kumo Breakout B-Long", colorup=green, maxheight=90)

//Kumo Breakout (Long) Alerts
LongSpanA_Cross = SpanA_Top ==1 and crossover(source, SpanAA)
alertcondition(LongSpanA_Cross, title="Kumo Breakout A-Long", message="Kumo Long")
LongSpanB_Cross = SpanB_Top ==1 and crossover(source, SpanBB)
alertcondition(LongSpanB_Cross, title="Kumo Breakout B-Long", message="Kumo Long")

//Kumo Breakout (Short)
ShortSpanA = SpanBB > SpanAA and source[1] > SpanAA[1] and source < SpanAA ? 1 : 0
ShortSpanB = SpanAA > SpanBB and source[1] > SpanBB[1] and source < SpanBB ? 1 : 0
cdnC = ShortSpanA == 1 ? ShortSpanA : 0
cupC = ShortSpanB == 1 ? ShortSpanB : 0

//Kumo Breakout (Short)
plotarrow(cdnC*-1, title="Kumo Breakout A-Short", colordown=red, maxheight=90)
plotarrow(cupC*-1, title="Kumo Breakout B-Short", colordown=red, maxheight=90)

//Kumo Breakout (Short) Alerts
ShortSpanB_Cross = SpanA_Top ==1 and crossunder(source, SpanBB)
alertcondition(ShortSpanB_Cross, title="Kumo Breakout B-Short", message="Kumo Short")
ShortSpanA_Cross = SpanB_Top ==1 and crossunder(source, SpanAA)
alertcondition(ShortSpanA_Cross, title="Kumo Breakout A-Short", message="Kumo Short")
any timeframe ?
Yes Vaicru, I'm actually getting solid results on the 1 Min chart as well. I think the current volatility in the market certainly helps but I can help explain how to set up the alerts if needed.
Additionally, this is currently being used on the 1 min timeframe shown. This can also be set up for multiple time frames and set up as an alert so that when the condition is met you can check the chart quickly to make a trading decision.
Can you help on stating this line in thinkscript? donchian(len) => avg(lowest(len), highest(len)). Thanks.
Sure. DM me if you can on my profile or give me a follow so I can track you. I'm familiar with thinkscript since I used to code on that platform. I think there's an ichimoku equivalent or we can dig into the donchian channel code to get the similar result.
Update coming on the way for this script, where i've simplified the Kumo Breakout Alert script and added an Alert for the Kumo Twist. Keep ya posted.
Robert; Could you make an update or create a line of code to change the Chikou color once crosses above the cloud? Thanks.
@telepatico, that's actually a really good idea. I could make the color "dynamic" based on whether or not the Chikou is above the cloud or below the cloud, or even above/below price. Let me know what you think is the best idea.
Robert; Above the cloud will be a better option, as above the price could be below the cloud and above price, which still bearish, but above the cloud ti could be bullish. Not sure if possible above cloud and above price, as the 26, 52, settings in the future may not work properly. But again, above the cloud will be ok.
A more updated version of this Indicator for those interested

Ultimate Ichimoku 1.0
Great indicator. I was wondering, what's your reasoning behind changing the ichi from its standard settings to the settings you've chosen? This isn't a loaded question or anything. I just can't find anything online that discusses the settings you've used, and I was wondering what made you think to change the settings. Thanks!
TraderR0BERT PRO Sigep1901dl
@sigep1901dl, hey, i don't see that as a loaded question. you're just asking. So I doubled the normal settings. A very successful ichimoku trader (Stocks), called TriforceTrader actually uses these settings. I find them to be more reliable as the breakouts from the clouds are much more meaningful breakouts. you should google TriforceTrader and read some of his stuff. Millionaire trader, and he's probably 26 years old.
Sigep1901dl TraderR0BERT
Thanks so much for responding so quickly Robert. The signals definitely work for my purpose, and now its nice to know 'why', instead of blindly following something. I trade forex, but also do some binaries on Nadex, and the signals here provide very high probability when I'm on a 15M chart. Also, I'll definitely check out Triforce Trader too.
Good day and thank you for the work on this indicator. Do you think this can be modified so that you can have two ichimoku setting on the same screen? I am looking for a way to have the 4H hour and the Daily Ichimoku setting on one chart or 1Hour and 4Hour ichmoku on a chart Like I had on my fxcm platform.
Ideas Scripts Chart
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