Trabalho concluído
Termos de Referência
I need a Donchian channel indicator using standard Donchian channel calculation rules with the following features:
1. Multi-timeframe support - display an upper timeframe Donchian channel on a lower timeframe. It should support all the available timeframes (different for MT4 and MT5).
2. Support for several type of price data for the upper and lower bands (determined via input parameters):
2.1. Normal: the Highest High and the Lowest Low.
2.2. The average between the Highest High and Highest Open and the average between the Lowest Low and Lowest Open.
2.3. The average between the Highest High and Highest Close and the average between the Lowest Low and Lowest Close.
2.4. The Highest Open and the Lowest Open.
2.5. The Highest Close and the Lowest Close.
3. Support for a Shift parameter to determine the starting bar for calculation of the channel. Default = 0 - the current bar.
4. Support for the optional support and resistance zones (DRAW_FILLING in MT5, DRAW_HISTOGRAM in MT4) based on the following parameters depending on the type of price used (see paragraph #2):
4.1. If the Donchian channel is using normal price - Highest High and Lowest Low, then the second level to determine the S/R zone is the Highest Low for the upper band and the Lowest High for the lower band.
4.2. If the Donchian channel is based on the case described in paragraph #2.2, then the second level to determine the S/R zone is the average of the Highest Low with Highest Open for the upper band and the average of the Lowest High with Lowest Open for the lower band.
4.3. If the Donchian channel is based on the case described in paragraph #2.3, then the second level to determine the S/R zone is the average of the Highest Low with Highest Close for the upper band and the average of the Lowest High with Lowest Close for the lower band.
4.4. If the Donchian channel is based on the case described in paragraph #2.4 or in paragraph #2.5, then the second level to determine the S/R zone is the Lowest High for the upper band and the Highest Low for the lower band.
5. The Center line to be placed at halfway between the upper and lower lines.
6. An Alert system:
6.1. Support for native alerts, email alerts, and push-notification alerts (all optional via input parameters).
6.2. Support for two kind of alert conditions (all optional via input parameters):
6.2.1. The candle opens on one side of the Center line and closes on the other side of it. Different alert text for Bullish or Bearish breaks.
6.2.2. The candle closes inside the support/resistance zone (described in paragraph #4) after opening outside of it. Different alert text for closing in the upper zone or in the lower zone. It is possible in some cases that the candle closes inside both zones at the same time - two separate alerts should be sent about this.
6.3. An input parameter to control which candle is checked for the alert - Current candle or Previous candle (default). When Current candle is used, only one alert should be issued per candle per alert event. So, in total, there can be four alerts per candles: Bullish break of the Center line, Bearish break of the Center line (p. #6.2.1), closing inside the upper zone, closing inside the lower zone (p. #6.2.2). When the alert candle is set to Previous, only three alerts per candle are possible: either Bullish or Bearish break of the Center line (p. #6.2.1) and closing inside upper or lower zones (both is is possible for intersecting zones; p. #6.2.1).
7. Handle exceptional situation correctly, including invalid input via parameters and the lack of chart data.
8. All plot colors should be set via #property, not dynamically.