Donchian Channels Indicator

Avatar
  • updated

What Are Donchian Channels?

Donchian Channels are three lines generated by moving average calculations that comprise an indicator formed by upper and lower bands around a midrange or median band. The upper band marks the highest price of a security over N periods while the lower band marks the lowest price of a security over N periods. The area between the upper and lower bands represents the Donchian Channel.

https://www.investopedia.com/terms/d/donchianchannels.asp

Image 5171

Image 5175

I don't remember where I got the code. Then I applied a fix to the code in "HIGH_LOW_OPEN" since the original was wrong.

Then I added one more buffer with the closing price of the candle to be able to use it in CP with the "Type=On Line Cross"

The buy signal is when the candle before the current one (Use closed bars only=true) is above the middle line (Color=clrYellow)

Sell when it is below.

Indicator:

donchian_channels.ex5
donchian_channels.mq5


Config:

Test_v2.54.set

Avatar
Ulises Cune

Hi, You can use this support and resistance indicator which uses Donchian Channels as Support and Resistance and you can open and close trades when it crosses the line.

https://forum.communitypowerea.com/communities/7/topics/815-support-and-resistance-indicator?redirect_to_reply=6377#comment-6377

Avatar
Andrey Khatimlianskyi
Quote from Thierry

Hello Ulises,
I would like to create the SL at a given time and not move it any further. As in the attached example, the SL is on the low of the previous candle AND it is touched later without having changed value.
Thanks for your help


Image 5998

That was my advice and it was stupid, sorry. You can't do this with Donchian, it moves every bar.

Avatar
Thierry

Hello Ulises,
I would like to create the SL at a given time and not move it any further. As in the attached example, the SL is on the low of the previous candle AND it is touched later without having changed value.
Thanks for your help


Image 5998

Avatar
Ulises Cune

I think it will never work because the indicator lines do not cross the candles.

Avatar
Thierry

Hello Uliss,

I would like to use your Donchian indicator to create stop losses (close if under/over the previous candle).

I've made several tests of number and type of entry but I can't get it to work. Attached are the screenshots.

Can you help me configure it properly?

Thanks

Image 5992

Image 5991

Avatar
ferdinand tampubolon

add volume indicator is good to know enter the market or false signal. ( sorry my english)

Avatar
Mudassar Rasool

Ulises did a very good work on setting up different custom indicators. I have tried this Donchian Channels setting. I found that in its current setting the middle line acts as MA price cross above (Buy) cross down (Sell).

Image 5939

Instead, if we use upper & lower boundaries of channel as extremum break it will be more helpful. I have tried different setting to adjust it but failed. I also tried different code file but donot find right settings. Unfortunately, I am not as good as Ulises to set custom indicators. If anybody can set it when price touch the upper or lower boundary it will generate signal.

Donchian Channel.ex5

Avatar
san takashima
Quote from aramabdo

I think he means this set not your set:

EURUSD +ZZ + Donchian channel.set

Sorry, I was not specific.... yes. I meant this set.

Avatar
aramabdo
Quote from san takashima

thank you!!!!!

The test set by Ulises is different from the set provided by san takashima


Avatar
aramabdo
Quote from Ulises Cune

My set was just a test of using the indicator, it is not a strategy. Read the manual and program the strategy.

I think he means this set not your set:

EURUSD +ZZ + Donchian channel.set