- Functions for getting the basic properties of the current chart
- Chart identification
- Getting the list of charts
- Getting the symbol and timeframe of an arbitrary chart
- Overview of functions for working with the complete set of properties
- Descriptive chart properties
- Checking the status of the main window
- Getting the number and visibility of windows/subwindows
- Chart display modes
- Managing the visibility of chart elements
- Horizontal shifts
- Horizontal scale (by time)
- Vertical scale (by price and indicator readings)
- Colors
- Mouse and keyboard control
- Undocking chart window
- Getting MQL program drop coordinates on a chart
- Translation of screen coordinates to time/price and vice versa
- Scrolling charts along the time axis
- Chart redraw request
- Switching symbol and timeframe
- Managing indicators on the chart
- Opening and closing charts
- Working with tpl chart templates
- Saving a chart image
Horizontal shifts
Another nuance of displaying charts is the horizontal indents from the left and right edges. They work slightly differently but are described in the same enumeration ENUM_CHART_PROPERTY_DOUBLE and use the type double.
Identifier |
Description |
---|---|
CHART_SHIFT_SIZE |
The indent of the zero bar from the right edge in percentages (from 10 to 50). Active only when the CHART_SHIFT mode is on. The shift is indicated on the chart by a small inverted gray triangle on the top frame, on the right side of the window. |
CHART_FIXED_POSITION |
The location of the fixed position of the chart from the left edge in percent (from 0 to 100). A fixed chart position is indicated by a small gray triangle on the horizontal time axis and is shown only if automatic scrolling to the right when a new tick arrives is disabled (CHART_AUTOCROLL). A bar that is in a fixed position stays in the same place when you zoom in and out. By default, the triangle is in the very corner of the chart (bottom left). |
Visual representation of horizontal padding properties
We have the ChartShifts.mq5 script to check access to these properties, which works similarly to ChartMode.mq5 and differs only in the set of controlled properties.
void OnStart()
|
Dragging a fixed position label (lower left) with the mouse results in this logging output.
Initial state:
|