Madrid

Madrid Donchian Bar

This is the companion bar of the Donchian Channel study. This bar at the bottom of the screen depicts the detrended position of the closing price. This is useful to reduce clutter on the screen and locate the position of the closing price at a glance.
Lime ; Extremely Bullish
Green : Bullish
Maroon : Bearish
Red : Extremely Bearish

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
// Hector R. Madrid : 15/JUN/2014 : 23:07 : 2.0 : Madrid Donchian Bar
study("Madrid Donchian Bar", shorttitle="MDonchianBar")

len = input(13)

src = close

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

// Donchian Indicator
mdcb = (src-midBar)/(highestBar-lowestBar)
ceilFloor = mdcb<-0.25 ? -0.5 : mdcb<0 ? -0.25 : mdcb<0.25 ? 0.25 : 0.5

ceilFloorColor = ceilFloor==-0.50 ? red
               : ceilFloor==-0.25 ? maroon
               : ceilFloor==0.25  ? green 
               : ceilFloor==0.50  ? lime
               : yellow               
               
// output
plot(1, linewidth=3, style=columns, color=ceilFloorColor, transp=30)