RobotFX curates the best open-source MetaTrader code to inspire your trading automation.
Real author:
Forex-TSD.com
The indicator changes color of bars in a separate window. It is changed to the color of the current trend calculated based on the RSI technical indicator.
Trade the powerful Traders Dynamic Index strategy automatically with this dedicated TDI Expert Advisor. More details.
If the trend and candlestick direction match, the color of the bar is light, if opposite, the bar is dark.
Trend strength is determined by the presence of the RSI indicator in overbought or oversold areas whose levels are determined by the indicator input parameters:
input uint HighLevel=55; // Overbought level input uint LowLevel=45; // Oversold level
If the RSI is outside these areas, the bar is painted in light gray.

Figure 1. The RSIFilter indicator
Build better strategies with RobotFX professional tools – check them out.
2125