Join our fan page
- Views:
- 7417
- Rating:
- Published:
- 2011.04.08 12:04
- Updated:
- 2016.11.22 07:32
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
The indicator plots a graph of a sin(x) function in the separate window.
The histogram color, width and line style are changed randomly every N ticks. The period of the sin(x) function depends on bars input parameters. The DRAW_HISTOGRAM drawing style is used to plot the histograms (for example the ocsillators). It allows to avoid drawing some of the indicator's values by setting the PLOT_EMPTY_VALUE. Only one data buffer is needed for the DRAW_HISTOGRAM style.
Note that initial properties of the plot1 graphic plot (DRAW_HISTOGRAM) are defined using the #property preprocessor directive, further these properties changed randomly (OnCalculate() function). The N variable is defined as input parameter, it can be changed manually using the "Properties" window.
See also: The Drawing Styles in MQL5.
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/332

The DRAW_SECTION drawing style is used for plotting the values of the indicator's buffer as a sections.

The DRAW_LINE style is used for plotting the values of the indicator's buffer as a line.

The DRAW_HISTOGRAM2 drawing style is used for plotting the values of two indicator's buffers as a histogram.

The DRAW_CANDLES drawing style plots the candles using the values of 4 indicator buffers with Open, High, Low and Close prices.