Donchian Channels Indicator
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
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:
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).
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