ChrisMoody

Enhanced Ichimoku Cloud Indicator!!!

There are two Custom Ichimoku Indicators on the chart.

The one that is hidden is the Ichimoku Indicator with
The correct names for the lines Under the Style Tab.

The Indicator shown is coded so when the cloud is in
a down trend both lines turn Red.

When the Cloud is rising both lines turn to Green.

Because of the code used in order to switch the colors of
Both Lines at the same time I couldn't name Senkou Span A
and Senkou Span B in the "Styles" Tab.

You can still modify the colors to customize chart.

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
//Created By User ChrisMoody
//Last Update 12-30-2013
//Special Thanks to Alex in Tech Support.  I spent 4 hours and couldn't get it to work and he fixed it in 2 minutes...

study(title="CM_Enhanced_Ichimoku Cloud-V3", shorttitle="CM_Enhanced_Ichimoku-V3", overlay=true)
turningPeriods = input(9, minval=1), standardPeriods = input(26, minval=1)
leadingSpan2Periods = input(52, minval=1), displacement = input(26, minval=1)
donchian(len) => avg(lowest(len), highest(len))
turning = donchian(turningPeriods)
standard = donchian(standardPeriods)
leadingSpan1 = avg(turning, standard)
leadingSpan2 = donchian(leadingSpan2Periods)
 
plot(turning, title = 'Tenkan-Sen (9 Period)', linewidth=4, color=white)
plot(standard, title = 'Kinjun-Sen (26 Period)', linewidth=4, color=orange)
plot(close, title='Chinkou Span (Lagging Line)', linewidth=4, offset = -displacement, color=aqua)
 
spanColor = leadingSpan1>=leadingSpan2 ? lime : red

p1 = plot(leadingSpan1, title = 'Senkou Span A (26 Period)', linewidth=4, offset = displacement, color=spanColor)
p2 = plot(leadingSpan2, title = 'Senkou Span B (52 Period)', linewidth=4, offset = displacement, color=spanColor)
 
fill(p1, p2, color=silver, transp=40, title='Kumo (Cloud)')