Skip to content

Chart Constants

Chart Constants

Constants describing various properties of charts are divided into the following groups:

What’s new in MQL5

The new generation platform has two times more timeframes (21 vs 9). It also features new graphical objects and analytical tools. Object anchors can be placed in any position between the chart bars up to a minute. Moreover, when switching between timeframes, the accurate positioning of the control points of the object is preserved.

You can set any chart properties directly from an MQL5 program. The number of properties has been increased. CHART_SHOW and CHART_IS_DOCKED are among the most notable ones. They allow moving any chart beyond the terminal turning it into a full-fledged separate trading panel. Disable the display of unnecessary areas on the chart and place OBJ_CHART objects, indicators and an EA on it to get your own trading control center with all the necessary technical analysis tools.

The table shows the new properties allowing you to fully manage a symbol chart.

IDDescriptionProperty Type
CHART_SHOWPrice chart drawing. If false, drawing any price chart attributes is disabled and all chart border indents are eliminated, including time and price scales, quick navigation bar, Calendar event labels, trade labels, indicator and bar tooltips, indicator subwindows, volume histograms, etc.Disabling the drawing is a perfect solution for creating a custom program interface using the graphical resources.The graphical objects are always drawn regardless of the CHART_SHOW property value.bool
CHART_IS_OBJECTIdentifying “Chart” (OBJ_CHART) object – returns true for a graphical object. Returns false for a real chartbool r/o
CHART_CONTEXT_MENUShow chart on top of other chartsbool (default is ’true')
CHART_CROSSHAIR_TOOLEnabling/disabling access to the context menu using the right click.When CHART_CONTEXT_MENU=false, only the chart context menu is disabled. The context menu of objects on the chart remains available.bool (default is ’true')
CHART_MOUSE_SCROLLEnabling/disabling access to the Crosshair tool using the middle click.bool
CHART_EVENT_MOUSE_WHEELScrolling the chart horizontally using the left mouse button. Vertical scrolling is also available if the value of any following properties is set to true: CHART_SCALEFIX, CHART_SCALEFIX_11 or CHART_SCALE_PT_PER_BARWhen CHART_MOUSE_SCROLL=false, chart scrolling with the mouse wheel is unavailablebool (default is ’true')
CHART_EVENT_MOUSE_MOVESending messages about mouse wheel events (CHARTEVENT_MOUSE_WHEEL) to all mql5 programs on a chartbool
CHART_EVENT_OBJECT_CREATESend notifications of mouse move and mouse click events (CHARTEVENT_MOUSE_MOVE) to all mql5 programs on a chartbool
CHART_EVENT_OBJECT_DELETESend a notification of an event of new object creation (CHARTEVENT_OBJECT_CREATE) to all mql5-programs on a chartbool
CHART_KEYBOARD_CONTROLAllow managing the chart using a keyboard (“Home”, “End”, “PageUp”, “+”, “-”, “Up arrow”, etc.). Setting CHART_KEYBOARD_CONTROL to false disables chart scrolling and scaling while leaving intact the ability to receive the keys pressing events in OnChartEvent().bool
CHART_SHOW_OBJECT_DESCRDisplay textual descriptions of objects (not available for all objects)bool
CHART_SHOW_ONE_CLICKShowing the “One click trading” panel on a chartbool
CHART_IS_MAXIMIZEDChart window is maximizedbool
CHART_IS_MINIMIZEDChart window is minimizedbool
CHART_IS_DOCKEDThe chart window is docked. If set to false, the chart can be dragged outside the terminal areabool
CHART_FLOAT_LEFTThe left coordinate of the undocked chart window relative to the virtual screenint
CHART_FLOAT_TOPThe top coordinate of the undocked chart window relative to the virtual screenint
CHART_FLOAT_RIGHTThe right coordinate of the undocked chart window relative to the virtual screenint
CHART_FLOAT_BOTTOMThe bottom coordinate of the undocked chart window relative to the virtual screenint
Last updated on