DRAW_LINE - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

The indicator plots the bar's opening price as a line.
Line color, width, and style change randomly every N=5 ticks. Line width, color, and style can be determined using preprocessor directives or using the PlotIndexSetInteger() function. Dynamic changes in line properties allow the creation of "real-time" indicators that change based on the current status. Only one data buffer is required to draw the line style.
The initial properties of the plot1 graph are defined using the #property preprocessor directive, further these properties are randomly changed ( OnCalculate() function). The N variable is defined as an input parameter and can be changed using the Properties window.
See also: Drawing styles in MQL5 .

Attachment download
📎 draw_line.mq5 (4.38 KB)
Source: MQL5 #330
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •