This indicator colors candlesticks in different colors depending on the strength and direction of the trend, using Keltner channels.
The indicator is based on five symmetrical Keltner channels with different values of deviation in inputs. If a channel with a higher deviation is broken, a candlestick is colored in a brighter color. For a growing market shades of green and lime are used, for a falling market shades of red, pink and brown are used.
Five deviation levels and ten colors for trend display are used in the indicator. If there is no breakout of the lowest deviation level, the candlestick color will not change.
The indicator uses SmoothAlgorithms.mqh library classes (copy it to <terminal_data_folder>\MQL5\Include). The use of the classes was thoroughly described in the article "Averaging Price Series for Intermediate Calculations Without Using Additional Buffers".
Fig1. The ColorKeltnerCandles indicator
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/17842
The EA uses two Moving Averages, one MACD and one CCI. OnTradeTransaction is used to receive position opening time.ColorXWPR_Histogram_HTF
The ColorXWPR_Histogram indicator with the timeframe selection option available in the input parameters.