Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Indicator | DRAW COLOR CANDLES

An example of indicator, that draws candlesticks for the specified instrument in a separate window.

The color of candlesticks changes randomly every N ticks. The N parameter of indicator is made as external so that you can adjust it manually (the Inputs tab of indicator properties dialog box). Note, that initially there are 8 colors set for the plot1 graphical plotting using the #property compiler directive. Then, in the OnCalculate() function the color is chosen at random from predefined list.

See also The Drawing Styles in MQL5 article.

MetaTrader Experts, Indicators, Scripts and Libraries

349

Best MetaTrader Indicators + Profitable Expert Advisors