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.

Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
// 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)