Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

Views:
3437
Rating:
votes: 14
Published:
2011.04.07 15:33
Updated:
2016.11.22 07:32
draw_line.mq5 (4.38 KB)view

The indicator plots the open prices of the bars as a line.

The line color, width and style changed randomly every N=5 ticks. The width, color and style of a line can be defined using the preprocessor directives or using the PlotIndexSetInteger() function. The dynamic change of the line properties allows to create the "live" indicators that vary depending on the current state. Only one data buffer is needed for the DRAW_LINE style.

The initial properties of the plot1 graphic plot 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 using the "Properties" window.

See also: The Drawing Styles in MQL5.

DRAW_LINE


Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/330

DRAW_NONE DRAW_NONE

The DRAW_NONE drawing style is used in cases, when you need to calculate and show the values of the indicator in "Data Window", but the plotting isn't needed.

RouletteGame RouletteGame

The Roulette Game.

DRAW_SECTION DRAW_SECTION

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

DRAW_HISTOGRAM DRAW_HISTOGRAM

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