DRAW_COLOR_BARS - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

Indicator example to draw a bar chart of the specified instrument in a separate window.
The color of the bars changes randomly every N ticks. The N parameter of the indicator is set as an external parameter so that you can adjust it manually (Input tab of the indicator properties dialog box). Note that 8 colors are initially set for plot1 graph drawing (using the DRAW_COLOR_BARS style), using the #property compiler directive. Then, the color in the OnCalculate() function is randomly selected from the 14 colors stored in the colors[] array.
See the article Drawing styles in MQL5 .

Attachment download
📎 draw_color_bars.mq5 (8.81 KB)
Source: MQL5 #348
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •