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.

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
// 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)

関連のアイデア