I want to know how can be change the color of the candles based on some indicator. If it is possible how can we do it.
Any help appreciate.
I don't have all the details but from what I know, heres how its done.
1) When an indicator value is such that you want the candle color changed, you can paint over that candle using an indicator Histogram paint. You'll have 2 buffers, one is the high price, one is the low price. After you paint the histogram on the candle, the candle looks like its changed colors.
2) Look at the Heiken Ashi indicator in the MT5 terminal, they perform this operation with the indicator
Sorry i'm not more descriptive, hope its a good starting point
Please read article "The Drawing Styles in MQL5".
As examples you can use the following indicators:
iMovment - The indicator plots the candles with different colors depending on the trend direction and price movement.
Heiken-Ashi - The Heiken-Ashi indicator is looks like the candlestick chart, but it has some difference.
ColorBars - The ColorBars Indicator paints bars with different colors depending on the volume changes.
BW-ZoneTrade - The idea of this indicator has been proposed by Bill Williams in his book "New Trading Dimensions: How to Profit from Chaos in Stocks, Bonds and Commodities".