Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

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

author EAcpu | 5 reads | 0 comments |

DRAW_COLOR_BARS - indicator for MetaTrader 5

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 .

DRAW_COLOR_BARS - indicator for MetaTrader 5


Attachment download

📎 draw_color_bars.mq5 (8.81 KB)

Source: MQL5 #348

Verification code Refresh