albert.callisto

CM_Enhanced_Ichimoku Cloud-V5.1

Based upon Thanks Chris Moody !

Here are my changes, I looked at comments on the original page.

  • Thinner default lines, changed colors
  • Added options to add two extra Kijun with their own periods, useful to check resistance/support lines on different scales
  • Decreased height of arrows

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
// Created By User ChrisMoody (CM)
// Tweaked by Albert Callisto (AC)
// Last Update 31 Jan 2016
// Version 5.1
// (AC - 5.1) Thinner default lines, changed colors
// (AC - 5.1) Added options to add two extra Kijun with their own periods, useful to check support.
// (AC - 5.1) Decreased height of arrows

study(title="CM_Enhanced_Ichimoku Cloud-V5.1", shorttitle="CM_Enhanced_Ichimoku-V5.1", overlay=true)
turningPeriods = input(9, minval=1, title="Tenkan-Sen")
standardPeriods = input(26, minval=1, title="Kinjun-Sen")
specialAPeriods = input(52, minval=1, title="Kinjun-Sen auxiliary")
specialBPeriods = input(104, minval=1, title="Kinjun-Sen auxiliary II")

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)?")
sksA = input(true, title="Show Kinjun-Sen auxiliary")
sksB = input(true, title="Show Kinjun-Sen auxiliary II")
sll = input(true, title="Show Chinkou Span (Lagging Line)?")
sc = input(true, title="Show Cloud?")
cr1 = input(true, 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)
specialA = donchian(specialAPeriods)
specialB = donchian(specialBPeriods)
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 ? #225437 : #5B1A13 // bullish, bearish

//plots for 3 lines other than cloud.
plot(sts and turning ? turning : na, title = 'Tenkan-Sen (9 Period)', linewidth=1, color=orange)
plot(sks and standard ? standard : na, title = 'Kinjun-Sen (26 Period)', linewidth=2, color=green)
plot(sksA and specialA ? specialA : na, title = 'Kinjun-Sen auxiliary I', linewidth=2, color=gray)
plot(sksB and specialB ? specialB : na, title = 'Kinjun-Sen auxiliary II', linewidth=2, color=black)

plot(sll and close ? close : na, title='Chinkou Span (Lagging Line)', linewidth=1, offset = -displacement, color=blue)

//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=1, offset = displacement, color=col)
plot(sc and leadingSpan2 ? leadingSpan2 : na, title = 'Senkou Span B (52 Period) Cloud', style=line, linewidth=3, 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=1, offset = displacement, color=col)
p2 = plot(sc and span2plotU ? span2plotU  : na, title = 'Senkou Span B (52 Period) Below Span A Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
p3 = plot(sc and span1plotD ? span1plotD  : na, title = 'Senkou Span A (26 Period) Below Span B Cloud', style=linebr, linewidth=1, offset = displacement, color=col)
p4 = plot(sc and span2plotD ? span2plotD  : na, title = 'Senkou Span B (52 Period) Above Span A Cloud', style=linebr, linewidth=1, offset = displacement, color=col)

//Fills that color cloud based on Trend.
fill(p1, p2, color=#6BA583 , transp=70, title='Kumo (Cloud)')    // bullish cloud
fill(p3, p4, color=#D75442, transp=70, title='Kumo (Cloud)')    // bearish 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=black, maxheight=20, minheight=20, transp=0)
plotarrow(cr1 and cdnB*-1 ? cdnB*-1 : na, title="CrossDn Tenkan Kinjun Entry Arrow", colordown=black, maxheight=20, minheight=20, transp=0)