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:
5424
Rating:
(15)
Published:
2011.04.08 14:58
Updated:
2016.11.22 07:32
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The indicator plots the vertical section for each bar between the Open and Close prices.

The DRAW_HISTOGRAM2 drawing style can be used for a drawing in a separate window and main chart window. It doesn't plot empty values, the empty indicator values must be specified explicitly. Two data buffers are needed for the DRAW_HISTOGRAM2 style.

The color, width and style of the histogram changed randomly each N ticks. In the OnInit() function, it chooses a day of the week (invisible_day), the indicator values of the bars of this week day will be filled with empty values (PLOT_EMPTY_VALUE=0):

//--- define empty value
PlotIndexSetDouble(plot_index_DRAW_SECTION,PLOT_EMPTY_VALUE,0);

The initial properties of the plot1 graphic plot are defined using the #property preprocessor directive, further these properties changed randomly (OnCalculate() function).

See also: The Drawing Styles in MQL5.

DRAW_HISTOGRAM2


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

DRAW_HISTOGRAM DRAW_HISTOGRAM

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

DRAW_SECTION DRAW_SECTION

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

DRAW_CANDLES DRAW_CANDLES

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

DRAW_FILLING DRAW_FILLING

The DRAW_FILLING drawing style plots the filled area between the values of two indicator buffers. In fact, it plots two lines and fills the area between them with the specified color.