DRAW_COLOR_ZIGZAG – indicator MetaTrader 5

An example of indicator, that draws the saw by the High and Low prices, the DRAW_COLOR_ZIGZAG drawing style is used.

The color, thickness and style of zigzag lines are changed randomly every N ticks. Note, that initially there are 8 colors set for the plot1 graphical plotting (with the DRAW_COLOR_ZIGZAG 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.

The N parameter of indicator is made as external so that you can adjust it manually (the Inputs tab of indicator properties dialog box).

See also The Drawing Styles in MQL5 article.

Alternative:  XO - indicator MetaTrader 5

DRAW_COLOR_ZIGZAG



πŸ“ˆ ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks