Madrid

Madrid Donchian Channel

This study is based on the Donchian Channel. The idea is to show where the price is located referred to its recent highest and lowest values.
Donchian channel only displays one channel with two bands. This variation displays four bands. When the price is in the uppermost band it is bullish, when the price is in the lowest band it is bearish.
When the price is on either of these two extreme bands it is in a trending market. When it is bouncing around the midchannel line it is a trading market.
The channel lines change color according to the direction of the price.

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 đồ?
// Hector R. Madrid : 6/JUN/2014 : 15:35 : 2.0 : Donchian Channel
//
study("Madrid Donchian Channel", shorttitle="MDonCh", overlay=true)
src = close

length = input(13, "Length")

highestBar=highest(high, length)
lowestBar=lowest(low, length)
midBar=(highestBar+lowestBar)/2

// Output
channelColor = abs(highestBar-src) < abs(lowestBar-src) ? green : red
midChannel=plot(midBar, color=channelColor, style=line, linewidth=1)

upperChannel=plot(highestBar, color=channelColor, style=line, linewidth=1 )
lowerChannel=plot(lowestBar, color=channelColor, style=line, linewidth=1 )

upperMidChannel=plot(midBar+(highestBar-midBar)*0.5, style=line, linewidth=1, color=channelColor)
lowerMidChannel=plot(midBar-(midBar-lowestBar)*0.5, style=line, linewidth=1, color=channelColor)

fill(midChannel,upperChannel, color=green, transp=80)
fill(lowerChannel, midChannel, color=red, transp=80)

fill(upperMidChannel, upperChannel, color=green, transp=80)
fill(lowerChannel, lowerMidChannel, color=red, transp=80)

Ý tưởng liên quan