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:
There is a bug when changing "Type of extreme points" in the indicator for these 2 values (*CLOSE*)