- Types of Chart Events
- Chart Timeframes
- Chart Properties
- Positioning Constants
- Chart Representation
- Examples of Working with the Chart
Examples of Working with the Chart
This section contains examples of working with chart properties. One or two complete functions are displayed for each property. These functions allow setting/receiving the value of the property. These functions can be used "as is" in custom mql5 applications.
The screenshot below demonstrates the graphic panel illustrating how changing of the chart property changes its appearance. Clicking Next button allows setting the new value of the appropriate property and view the changes in the chart window.
The panel's source code is located below.
Chart Properties and Sample Functions for Working with Them
- CHART_IS_OBJECT defines if an object is a real chart or a graphic object.
- CHART_EVENT_MOUSE_MOVE is a property of sending messages concerning move events and mouse clicks to mql5 applications (CHARTEVENT_MOUSE_MOVE).
- CHART_EVENT_OBJECT_CREATE is a property of sending messages concerning the event of a graphic object creation to mql5 applications (CHARTEVENT_OBJECT_CREATE).
- CHART_EVENT_OBJECT_DELETE is a property of sending messages concerning the event of a graphic object deletion to mql5 applications (CHARTEVENT_OBJECT_DELETE).
- CHART_WINDOW_YDISTANCE defines the distance in pixels between the upper frame of the indicator subwindow and the upper frame of the chart's main window.
- CHART_FIRST_VISIBLE_BAR returns the number of the first visible bar on the chart (bar indexing corresponds to the time series).
- CHART_SHOW_TRADE_LEVELS – property of displaying trade levels on the chart (levels of open positions, Stop Loss, Take Profit and pending orders).
- CHART_DRAG_TRADE_LEVELS – property of enabling the ability to drag trading levels on a chart using mouse.