Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
6416
Rating:
(16)
Published:
2011.05.02 19:13
Updated:
2016.11.22 07:32
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

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.

DRAW_COLOR_ZIGZAG


Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/347

DRAW_COLOR_ARROW DRAW_COLOR_ARROW

The DRAW_COLOR_ARROW drawing style plots the color arrows (symbols from Windings font).

DRAW_COLOR_HISTOGRAM2 DRAW_COLOR_HISTOGRAM2

The DRAW_COLOR_HISTOGRAM2 drawing style is used to plot color histograms using two indicator buffers, the colors are specified in the color buffer.

DRAW_COLOR_BARS 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.

DRAW_COLOR_CANDLES DRAW_COLOR_CANDLES

The DRAW_COLOR_CANDLES style (as DRAW_CANDLES) draws candlesticks based on values of four indicator buffers, containing Open, High, Low and Close prices. In additions it allows you to specify color for each candlestick from a given set.