You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
DRAW_COLOR_BARS:
The DRAW_COLOR_BARS style draws bars based on values of four indicator buffers, containing Open, High, Low and Close prices. This is the advanced version of the DRAW_BARS style, that allows you to specify individual color for each bar from predefined color set.
The color of bars 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 (with the DRAW_COLOR_BARS style) using the #property compiler directive. Then, in the OnCalculate() function the color is chosen at random from 14 colors stored in the colors[] array.
See also The Drawing Styles in MQL5 article.
Author: MetaQuotes