- 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 scale (by time)
To determine the scale and number of bars along the horizontal axis, use the group of integer properties from ENUM_CHART_PROPERTY_INTEGER. Among them, only CHART_SCALE is editable.
Identifier |
Description |
---|---|
CHART_SCALE |
Scale (0 to 5) |
CHART_VISIBLE_BARS |
Number of bars currently visible on the chart (can be less than CHART_WIDTH_IN_BARS due to CHART_SHIFT_SIZE indent) (r/o) |
CHART_FIRST_VISIBLE_BAR |
Number of the first visible bar on the chart. The numbering goes from right to left, as in a timeseries. (r/o) |
CHART_WIDTH_IN_BARS |
Chart width in bars (potential capacity, extreme bars on the left and right may be partially visible) (r/o) |
CHART_WIDTH_IN_PIXELS |
Chart width in pixels (r/o) |
ENUM_CHART_PROPERTY_INTEGER properties on a chart
We are all ready to implement the next test script ChartScaleTime.mq5, which allows you to analyze changes in these properties.
void OnStart()
|
Below is a part of the log with comments about the actions taken.
Initial state:
|